discreet-app-rate icon indicating copy to clipboard operation
discreet-app-rate copied to clipboard

Crash on click if no app installed which can handle "market://" intent

Open alexeyvasilyev opened this issue 11 years ago • 1 comments

Steps to reproduce:

  1. Run in emulator or any other device which do not have Google Play installed.
  2. Call forceShow(). The apprate is shown.
  3. Press on AppRate to get a crash android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.myproject flg=0x10000000 }

Fix 1: In forceShow() should be if (!Utils.isGooglePlayInstalled(activity)) { if (debug) LogD("Play Store is not installed. Won't do anything"); return; }

instead of if (!Utils.isGooglePlayInstalled(activity)) { if (debug) LogD("Play Store is not installed. Won't do anything"); }

Fix 2: Use try {} catch (Exception e) {} in onClick() while calling Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); activity.startActivity(intent);

alexeyvasilyev avatar Mar 08 '15 10:03 alexeyvasilyev

Will be fixed in the next version.

PomepuyN avatar Mar 12 '15 14:03 PomepuyN