Question: Here is the code for back button. I want to kill other activities by back button but its not working in one activity, but I have other activities and without one activity its working fine. Please help me out. 

```
public void onClick(View v) {

    Intent intent = new Intent(getApplicationContext(),
                    SomeActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);

}

```

Answer: 
Might be this code will help you: 

```
public void onClick(View v) {
    Intent i = new Intent(getApplicationContext(), SomeActivity.class);
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(i);
    finish();
}

```
You can set `android:noHistory="true"` in activities tag in `AndroidManifest.xml` which you don't want to save in stack.