アクティビティA(スプラッシュアクティビティ)、アクティビティB(ホームアクティビティ)、アクティビティC(オファーアクティビティ)、アクティビティD(雑アクティビティ)があります。 >活動C->アクティビティDプッシュ通知の親アクティビティを維持するイベント
シナリオ - 活動A->アクティビティB:アプリケーション
一般的なアプリケーションフロー:私は2つのシナリオでオファー活動への適切なランディングを作成したいです閉じています。 (タスクマネージャには存在しません) 要件:プッシュ通知をクリックすると、ユーザーはアクティビティC(オファーアクティビティ)に直接着陸する必要があります。また、ボタンをクリックすると、ユーザーはアプリケーションを終了してはならず、アクティビティAを表示してからAをクリックすると終了する必要があります。 現在のシナリオ:今すぐ、通知が表示されたら、クリックすると、ユーザーはアクティビティCに移動しますが、その画面から戻ると、ユーザーは直接アプリケーションを終了します。なぜこれはそうですか?ここに私のparentactivityスタックコードは、プッシュ通知ランディングコード
<activity
android:name=".OffersActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:windowSoftInputMode="stateHidden">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.zotopay.zoto.HomeActivity" />
</activity>
<activity
android:name=".HomeActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:theme="@style/AppTheme"
>
</activity>
defaultConfig {
applicationId "com.zotopay.zoto"
minSdkVersion 14
targetSdkVersion 22
versionCode 1310145
versionName "1.4.5"
}
です:
Intent resultIntent = new Intent(this, OffersActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
// All the parents of OffersActivity will be added to task stack.
stackBuilder.addParentStack(OffersActivity.class);
// Add a SecondActivity intent to the task stack.
stackBuilder.addNextIntent(resultIntent);
PendingIntent contentIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
は、誰も私が私が間違っているのか知っている聞かせていただけますか?ホームアクティビティに着陸するのではなく、オファーアクティビティから戻るときにアプリケーションから退出することになります。
<メタデータ アンドロイド:名=「android.support.PARENT_ACTIVITY」 アンドロイド:値=「ui.MainActivity」/> –
pff、parentActivityNameはどこですか? –
これら2つの公式ドキュメントhttp://developer.android.com/intl/ru/guide/topics/manifest/activity-element.html#parent –