[Solved] FATAL EXCEPTION AGAIN [closed]


The build() method was added in API level 16 (Android 4.1). You are probably trying to run your code on an older version of Android.

The getNotification() method is deprecated starting at API level 16, but is fine to use in older API levels >= 11.

Note: The entire Notification.Builder class was added in API level 11 (Honeycomb), so I assume that your app’s minimum required API level is at least 11.

To fix your issue, you can use the following code.

Notification ya =
    (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) ?
        builder.build() : builder.getNotification();

6

solved FATAL EXCEPTION AGAIN [closed]