은 사용자가 당신이하는 Theme.Dialog를 테마 활동을 소개하는 당신에게 보류중인 의도 통지와 함께 추가 it'l 최고의 제품군에 있음을 같은 화면에 표시 할 빌더. 마찬가지로 : 당신에
// This sets the pending intent that should be fired when the user clicks the
// notification. Clicking the notification launches a new activity.
Intent intent = new Intent(this, YourDialogActivity.class);
//set flags according to your implementation
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_NO_HISTORY);
// startActivity(intent);
// Because clicking the notification launches a new ("special") activity,
// there's no need to create an artificial back stack.
PendingIntent resultPendingIntent =
PendingIntent.getActivity(
this,
0,
intent,
PendingIntent.FLAG_ONE_SHOT //also check the flags here
);
mBuilder.setContentIntent(resultPendingIntent);
// Gets an instance of the NotificationManager service
NotificationManager mNotifyMgr = (NotificationManager) getApplicationContext().getSystemService(NOTIFICATION_SERVICE);
// Builds the notification and issues it.
mNotifyMgr.notify(integerHere, mBuilder.build());
매니페스트, 테마 대화와 활동을 추가
<activity
android:name="com.package.YourDialogActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Dialog" />
을 상세한 구현을 위해, 참조 : Define the Notification's Action
이 방법, 당신의 MainActivity를 호출하지 않습니다 귀하의 응용 프로그램과 DialogActivity는 단지 응용 프로그램을 열고 응용 프로그램이 최소화되었을 때 마지막으로 열린 활동에 대한 대화 상자를 보여줍니다.
그런 다음'Notification'에서'Pending Intent'로'Page Position'을 설정하고'mainActivity'에서이 값을 가져 와서'View Pager'에서 해당 위치 당 페이지를로드하십시오. –