I have an issue in my app. I’m creating a sort of improvised menu bar that has to be included in all activities in my app, I want to determine which activity is loaded currently so that via an intent the application will link to the Activity that is linked to a button:
public void graphAction()
{
Intent i = new Intent(this, GraphActivity.class );
this.startActivity(i);
}
You might want to consider using ActionbarSherlock (http://actionbarsherlock.com/)
But I do not understand why you would want the currently active activity?
If the graphAction is not in the activity but some custom object, just pass the activity there (or better: use a context object, Activities should not be passed around)