Serviceを作成するAndroid ライブラリがありNotificationます。私が理解していることから、 ( ) を設定するNotification必要があります。そうしないと、ランタイム例外がスローされます。contentIntentPendingIntent
問題は、ユーザーがこれをそのまま使用しServiceたり、拡張したりしてPendingIntent、Notification. ただし、これを行わないことを選択しPendingIntentた場合は、例外がないように を何かに設定する必要があります。PendingIntentフィルインとして機能するダミーを作成する方法はありますか?
createNotificationメソッドのコードの例を次に示します。
PendingIntent p;
if(getPendingIntentCallback != null) {
p = getPendingIntentCallback.getPendingIntent();
}
else {
p = ?;
}
notification.contentIntent = p;