I have two activities, A and B. I have a button in A,when pressed starts a new intent to B. However whenever I press the back button while in B, than click the button again is restarts Activity.I do not want to do that,I want it to resume Activity B. Actually I am doing some networking in Activity B and I want to save unless the user wants to refresh. How can I do it? Thanks in advance
Use
@Override
public void onBackPressed(){
moveTaskToBack(true);
}
Hope, It must help you
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