Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
sw926 committed Jan 22, 2018
1 parent 52f6ca0 commit 1ddc0c3
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,24 @@ public void selectorImage(@NonNull Activity activity, int requestCode) {
private void startSelect() {
AppLogger.i(TAG, "start system gallery activity");
if (mActivity != null) {
mActivity.startActivityForResult(createIntent(), mRequestCode);
try {
mActivity.startActivityForResult(createIntent(), mRequestCode);
} catch (Exception e) {
if (mCallback != null) {
mCallback.onError(error);
}
}
return;
}

if (mFragment != null) {
mFragment.startActivityForResult(createIntent(), mRequestCode);
try {
mFragment.startActivityForResult(createIntent(), mRequestCode);
} catch (Exception e) {
if (mCallback != null) {
mCallback.onError(error);
}
}
return;
}
AppLogger.e(TAG, "activity or fragment is null");
Expand Down

0 comments on commit 1ddc0c3

Please sign in to comment.