mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Minor change but this code is not used any more.
TODO:remove it
This commit is contained in:
parent
dd47fcb42a
commit
24bf0c7874
1 changed files with 18 additions and 14 deletions
|
@ -113,20 +113,24 @@ public class PillDroidJobService extends JobService {
|
||||||
String description = getString(R.string.channel_description);
|
String description = getString(R.string.channel_description);
|
||||||
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
String CHANNEL_ID = "PillDroid";
|
String CHANNEL_ID = "PillDroid";
|
||||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
NotificationChannel channel;
|
||||||
channel.setDescription(description);
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
// Register the channel with the system; you can't change the importance
|
channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
||||||
// or other notification behaviors after this
|
|
||||||
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
channel.setDescription(description);
|
||||||
try {
|
// Register the channel with the system; you can't change the importance
|
||||||
notificationManager.createNotificationChannel(channel);
|
// or other notification behaviors after this
|
||||||
} catch (Exception e) {
|
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
||||||
// This will catch any exception, because they are all descended from Exception
|
try {
|
||||||
Log.e(TAG, e.toString());
|
notificationManager.createNotificationChannel(channel);
|
||||||
//At the level Exception Class handle the error in Exception Table
|
} catch (Exception e) {
|
||||||
// Exception Create That Error Object and throw it
|
// This will catch any exception, because they are all descended from Exception
|
||||||
//E.g: FileNotFoundException ,etc
|
Log.e(TAG, e.toString());
|
||||||
e.printStackTrace();
|
//At the level Exception Class handle the error in Exception Table
|
||||||
|
// Exception Create That Error Object and throw it
|
||||||
|
//E.g: FileNotFoundException ,etc
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue