アプリケーションの通知を使用して新しいアプリケーションを開始する方法を教えてください。NotificationManager には、生成された通知にアクセスできるメソッドがありません。助言がありますか?ありがとう。
1 に答える
0
で通知を作成する必要がありPendingIntent
ます。Android 開発者から:
Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";
Intent notificationIntent = new Intent(this, MyClass.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
private static final int HELLO_ID = 1;
mNotificationManager.notify(HELLO_ID, notification);
MyClass
通知から開始したいアクティビティはどこにありますか。
于 2012-07-08T10:56:03.940 に答える