I have two activities A and B. B is a transparent pass through activity, and A is seen. I want to kill B by pressing a button A.
Here\'s what I\'ve tried so far:
You could try to directly kill an activity by calling a static method in that activity:
Activity A should have a variable
static ActivityA activityA;
In onCreate state:
activityA = this;
and add this method:
public static ActivityA getInstance(){
return activityA;
}
In activity B, call the function getInstance()
ActivityA.getInstance().finish();