i have two activities: A and B.
from A to B:
onCreate
Context context = this;
onClick
Intent i = new Intent(context,B.class);
startActivity(i);
from B to A: (if B has a button to return to A)
button.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
finish();
}
});
But if the flow is like:
A call B, the user that is watching B clicks Home button and click again B from launched activities and clicks the button to call finish(), it goes to Home and not to my first activity A. How can i do it?
EDIT:
flow
can you try this :-
WHY ARE YOUR USING getApplicationContext()
instead of use this
or Activity A name.
A ->B
Intent i = new Intent(yourcurrentActivity,B.class);
startActivty(i);
B ->A
call finish()
update if you are using this:- remove it
android:noHistory="true";