I am showing a dialog box on top of other applications. it is working till i use WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
As i am changing my target version to 26, i should not use TYPE_SYSTEM_ALERT, So i used WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
after that my dialog is not visible. What else i have to do? Any suggestion.
Reference link: https://developer.android.com/about/versions/oreo/android-8.0-changes#cwt
Code:
final Dialog dialog = new Dialog(getApplicationContext());
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.permission);
dialog.setCancelable(true);
dialog.show();