I have an activity which i am using as a dialog in my app(by making use of Theme.Dialog
and startActivity(dialogactivityintent)
). But I don't want it to close when the user presses the back button (which all android phones have). I've searched a lot but couldn't find a solution to this.
Please help me out. Thanks in advance!
EDIT: I've tried using setCancelable(false)
but in vain.
HI use the following code::
Paste this line next to setContentView(R.layout.main)
this.setFinishOnTouchOutside(false);
and disable the back Key using the following line:
@Override
public void onBackPressed() {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With