Reputation: 87
i have two activities. On 1st activity i have button after click on button it will show dialog window and after click on dialog button i will jump to 2nd activity. On 2nd acitivity i have custom button which is calling onBackPressed() method:
private void btnBackListener(){
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
My Problem is when im on 2nd activity and i call onBackPressed(); it will jump into 1nd activity but also dialog is visibile. How to prevent showing that dialog after btnBack clicked in 2nd activity?
Upvotes: 0
Views: 46
Reputation: 68
In your case, I think best option would be to close dialog before opening 2nd activity.
Upvotes: 1