Skip to content

Commit

Permalink
picking image from camera issue resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
samkazmi committed Jul 18, 2017
1 parent caf0f31 commit e7f789c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void chooseSingleImage(int type, Activity activity) {
}
}

public void chooseSingleImage(int type, Fragment fragment) {
public static void chooseSingleImage(int type, Fragment fragment) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(fragment.getContext());
CHOOSE_TITLE = preferences.getString("title", "Select photo from");
APP_NAME = preferences.getString("folderName", "AppName");
Expand All @@ -70,10 +70,10 @@ public static String onActivityResult(Context context, int requestCode, int resu
// Bundle extras = data.getExtras();
// Bitmap imageBitmap = (Bitmap) extras.get("data");
if (requestCode == Config.REQUEST_CODE_PICK_SINGLE_IMAGE && resultCode == Activity.RESULT_OK) {
if (data == null) {
return getPathOfImagePathTakenFromCamera();
} else {
if (data != null && data.getData() != null) {
return getPathOfImageTakenFromGallery(data, context);
} else {
return getPathOfImagePathTakenFromCamera();
}
} else if (resultCode == Activity.RESULT_CANCELED) {
if (photoFile != null) {
Expand Down

0 comments on commit e7f789c

Please sign in to comment.