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:
Create static Class variable to save the instance: static SampleActivity sampleActivity;
On Create of first Activity save the Instance, like this: incidenteActivity = this;
Create a static method to get the instance:
public static SampleActivity getInstance(){
return sampleActivity;
}
wherever you want call:
SampleActivity.getInstance().finish();
it really works, regards,