while creating application I faced a architecture problem. I want to do like this : ![enter image description here](https://i.stack.imgur.com/nCQ6y.png)

I thing everything is shown clearly. By the way. While app user is in Menu activity, and if he press back button, (not Logout method) he does not log out. 
I'm newbie in android, could someone give me an advice ?
what methods should i use ?

```
                Intent menuIntent = new Intent(
                        "com.project.simplify.NewReviewActivity");
                menuIntent.putExtra("user", user);
                menuIntent.putExtra("link", realLink);
                startActivity(menuIntent);

```

here is the Logout method : 

```
Intent loginIntent = new Intent(this, LoginActivity.class);
                loginIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                startActivity(loginIntent);

                finish();

```

How i ***solved*** my problem : 

```
public static MenuActivity MenuActivityObject;

onCreate()
{
    MenuActivityObject = this;
}

```

now use that object in logout method to finish menu activity:

```
Logout()
{
    MenuActivity.MenuActivityObject.finish();
}

```