Skip to content

Commit

Permalink
Merge pull request zhihu#14 from gejiaheng/capture
Browse files Browse the repository at this point in the history
Fix capture crash
  • Loading branch information
gejiaheng committed Apr 23, 2017
2 parents f6ed359 + 888d017 commit ef2ac6b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public SelectionSpecBuilder captureStrategy(CaptureStrategy captureStrategy) {
/**
* Set the desired orientation of this activity.
*
* @param orientation An orientation constant as used in {@link ScreenOrientation}. Default value is {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_PORTRAIT}.
* @param orientation An orientation constant as used in {@link ScreenOrientation}.
* Default value is {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_PORTRAIT}.
* @return {@link SelectionSpecBuilder} for fluent API.
* @see Activity#setRequestedOrientation(int)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class AlbumLoader extends CursorLoader {
String.valueOf(MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO),
};
private static final String BUCKET_ORDER_BY = "datetaken DESC";
private static final String MEDIA_ID_DUMMY = String.valueOf(-1);

public AlbumLoader(Context context) {
super(context, QUERY_URI, PROJECTION, SELECTION, SELECTION_ARGS, BUCKET_ORDER_BY);
Expand All @@ -72,7 +71,8 @@ public Cursor loadInBackground() {
} else {
allAlbumCoverPath = "";
}
allAlbum.addRow(new String[]{Album.ALBUM_ID_ALL, Album.ALBUM_ID_ALL, Album.ALBUM_NAME_ALL, allAlbumCoverPath, String.valueOf(totalCount)});
allAlbum.addRow(new String[]{Album.ALBUM_ID_ALL, Album.ALBUM_ID_ALL, Album.ALBUM_NAME_ALL, allAlbumCoverPath,
String.valueOf(totalCount)});

return new MergeCursor(new Cursor[]{allAlbum, albums});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Cursor loadInBackground() {
return result;
}
MatrixCursor dummy = new MatrixCursor(PROJECTION);
dummy.addRow(new Object[]{Item.ITEM_ID_CAPTURE, Item.ITEM_DISPLAY_NAME_CAPTURE, "", 0});
dummy.addRow(new Object[]{Item.ITEM_ID_CAPTURE, Item.ITEM_DISPLAY_NAME_CAPTURE, "", 0, 0});
return new MergeCursor(new Cursor[]{dummy, result});
}

Expand Down

0 comments on commit ef2ac6b

Please sign in to comment.