質問

ってアプリを作ろうと思うことでandroidマーケットのページの選択したアプリ&ーユーザーのダウンロードします。また以下の趣旨で開きます。

  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);

もっresultcode0onActivityResult.StackTrace言うのです:

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.

だいたいのは市場を返しまってい対応によりユーザーをダウンロードアプリだけで解約となります。

編集: @CommonsWareいアクセスしようとしている追加のパッケージは、ここん図うにするということではなくパッケージ名からエキストラのACTION_PACKAGE_ADDED

public class ServiceReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
    //Do this when the system sends the intent
    Bundle b = intent.getExtras();
    String packagename = b.get(?);   //cant figure what should be key to get packagename //from extras
    }

}
役に立ちましたか?

解決

のAndroidマーケットが設定されていませんの支援 startActivityForResult().また、このダウンロード-インストールが非同期で(つまり、ユーザがインストールのダウンロードが発生した背景に合わない場合はご相談くださいインストールの Notification).

他のヒント

@CommonsWare絶景です!

ソリューションが立で水揚げされたも非常に有用ページ http://devdaily.com/java/jwarehouse/android/core/java/com/android/internal/content/PackageMonitor.java.shtml

以下のコードスニペットからリンク元のウェブサイトに関しにパッケージ名の現在インストールされてアプリから放送の趣旨:

 String getPackageName(Intent intent) {
        Uri uri = intent.getData();
        String pkg = uri != null ? uri.getSchemeSpecificPart() : null;
        return pkg;
    }

コCommonsware.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top