I try to add "rank this app" button in my app
Uri uri = Uri.parse("market://details?id=" + context.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(goToMarket);
then I get Error "Android : No Activity found to handle Intent"
BTW : I use SurfaceView I don't know if it is important
This might happen because:
Add try catch to prevent from crash, if there is no market app is installed in your device
try
{
context.startActivity(goToMarket);
}
catch (Exception e)
{
//Show Toast
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.