1

を引き起こしローカル通知は、私がアプリケーションをビルドするとき、それはすべて私がGoogleのコンソールクラッシュレポートを解放した後、これを受けたすべてのエラー/警告なしに明らかだ、進捗の読み込みが完了したときにローカル通知を送信する方法を行っているにSecurityException

ここでが通知方法である:

public void notif() { 

    final int NOTIFICATION_ID = 1; 
    int icon = getIcon(); 
    String provx = getProv(); 

    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getBaseContext()); 
    Notification notification = mBuilder 
      .setSmallIcon(icon)    
      .setVibrate(new long[]{1000, 1000}) 
      .setLights(Color.BLUE, 700, 500) 
      .setContentTitle("New notification!") 
      .setStyle(new NotificationCompat.BigTextStyle().bigText(provx)) 
      .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) 
      .setContentText(provx) 
      .build(); 

    NotificationManager nMN = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 
    nMN.notify(NOTIFICATION_ID, notification); //here where I got the error 
} 

これは、クラッシュログです:

java.lang.SecurityException: 
    at android.os.Parcel.readException (Parcel.java:1425) 
    at android.os.Parcel.readException (Parcel.java:1379) 
    at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag (INotificationManager.java:246) 
    at android.app.NotificationManager.notify (NotificationManager.java:135) 
    at android.app.NotificationManager.notify (NotificationManager.java:111) 
    at com.dev.days.myapp.Splash.notif (Splash.java:184) 
    at com.dev.days.myapp.Splash$1.run (Splash.java:151) 
    at java.lang.Thread.run (Thread.java:856) 
+2

あなたは[ 'VIBRATE'](https://developer.android.com/referenceを保持してくださいmanifestファイルにVIBRATE許可を追加することで解決した。この上で示唆したように/android/Manifest.permission.html#VIBRATE)のアクセス許可ですか? –

+0

いいえ、振動の使用が許可されていますか?はいの場合はそれを提供してください –

答えて

1

@Adam Sは、単に

<uses-permission android:name="android.permission.VIBRATE" /> 
関連する問題