Currently i am using below code for asking overlay permission
if (!isSystemAlertPermissionGranted(context)) {
/* if not construct intent to request permission */
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + BuildConfig.APPLICATION_ID));
/* request permission via start activity for result */
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return false;
}
But I seen that some app like Facebook messenger can draw over other app without asking overlay permission. Now m curious about this how they can do that. any lead is helpful for me!!!