次のコードがあります。これは、通知中に新しいアクティビティを初期化することを想定しています。これはサービス クラスにあります。
Intent push = new Intent();
push.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
push.setClass( context, MyActivity.class );
PendingIntent pi = PendingIntent.getActivity( context, 0, push, PendingIntent.FLAG_ONE_SHOT );
long[] vibraPattern = {0, 500, 250, 500 };
Notification noti = new Notification.Builder( getApplicationContext() )
.setVibrate( vibraPattern )
.setDefaults( Notification.DEFAULT_SOUND )
.setFullScreenIntent( pi , true )
.setContentIntent( pi )
.getNotification();
notifMng.notify( 0 , noti );
音とバイブレーションがうまく動くので通知は成功しますが、この通知の FullScreenIntent であるにも関わらず MyActivity は作成されません。