How to check notification accessibility service is enabled or not by user in android ?
Intent intent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
startActivity(intent);`
I have tried this code but this is not working.
How to check notification accessibility service is enabled or not by user in android ?
Intent intent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
startActivity(intent);`
I have tried this code but this is not working.
You can try following code to check weather your service is running or not:
public boolean isMyServiceRunning(Activity activity) {
ActivityManager manager = (ActivityManager) activity
.getSystemService(Context.ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager
.getRunningServices(Integer.MAX_VALUE)) {
if (NotificationService.class.getName().equals(
service.service.getClassName())) {
return true;
}
}
return false;
}
It will return true if service is running currently otherwise its return false.