I am trying to create an application that opens the Android market page of the selected application and allows the user to download it. I used the intention below to open the market.
Intent intent = new Intent (Intent.ACTION_VIEW); intent.setData (Uri.parse ("market://details?id=" + PackageName )); intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); startActivityForResult (intent, 13);
but I always get resultcode 0 in onActivityResult.StackTrace says:
I/ActivityManager( 79): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.apps.unveil flg=0x10000000 cmp=com.an droid.vending/.AssetInfoActivity } W/ActivityManager( 79): Activity is launching as a new task, so cancelling activity result.
What I want is that the market returns me some answer that the user uploaded or simply canceled.
EDIT: @CommonsWare I'm trying to access the added package here. But I canβt understand what should be the key to get the package from the additional ACTION_PACKAGE_ADDED actions
public class ServiceReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) {
source share