I am getting problem with custom dialog, i created custom dialog and it works properly but im having confusion about not showing it again if user click on button. Like there is a button named rating when ever user click on that button then custom dialog will never open again. So if anyone knows how to do it then please help me
This is my code
final Dialog dialogrul = new Dialog(MainActivity.this);
dialogrul.requestWindowFeature(Window.FEATURE_NO_TITLE);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
Window window = dialogrul.getWindow();
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
dialogrul.setContentView(R.layout.exitlayout);
Button rating = dialogrul.findViewById(R.id.ratingok);
Button dialogok = dialogrul.findViewById(R.id.exityes);
final Button dialognotok = dialogrul.findViewById(R.id.exitno);
dialogrul.setCancelable(true);
dialogrul.show();
dialogok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MainActivity.this.onSuperBackPressed();
finish();
}
});
rating.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent j = new Intent(android.content.Intent.ACTION_VIEW);
j.setData(Uri.parse("https://play.google.com/store/apps/details?"));
startActivity(j);
}
});
dialognotok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialogrul.cancel();
}
});
}