通知ボタンをクリックした後でステータスバーを閉じるにはどうすればよいですか?ボタン通知がクリックされたときにステータスバーを閉じる
は私がthisを試してみましたが、私は例外を持っていた:
java.lang.NoSuchMethodException: collapse []
at java.lang.Class.getConstructorOrMethod(Class.java:460)
at java.lang.Class.getMethod(Class.java:915)
...
は私のコード:NotificationIntentクラス
@Override
public void onReceive(Context context, Intent intent) {
int notificationID = intent.getExtras().getInt("NOT_ID");
this.callbackContext = StatusBarNotification.getCallback();
this.mNotificationManager = StatusBarNotification.getNotificationManager();
this.mNotificationManager.cancel(notificationID);
this.callbackContext.success(returnJSON(intent));
}
あなたは本当にサム呂のコメントを受け入れる必要があります - あなたのソリューションは、任意の次のバージョンに取り組んで停止することがあり、それは非使用しているため、公開API。あなたが見ているように、alredyは 'if api <= 16'を追加する必要がありました。すぐに' if api <= 19'を追加する必要があります。 – imbryk
上記のコメントに同意してください。 Samの答えははるかに簡単で、バージョン番号を扱わない。 – Saik