I need the user to enable the Notification Listener permission for my app. For now i just start a new activity as below, but would like that when then user allows the permission, it goes back to my activity by itself?
startActivity(new Intent(android.provider.Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));
I figured it out by creating a handler that check every half second if the notification listener contains my package and when true opens my activity again.