lacas
lacas

Reputation: 14066

Android Main activity to Browser activity error

I have a main activity, then i call a new activity intent from this. Lets call this SecondActivity. Then from my secont activity i call a browser intent. Then my browser intent call my second activity's onNewIntent method.

Evereything work fine, but when i click on "back" button on my phone on my second activity, i will not going to my main activity, but the browsers activity, why?

How can i solve this?

Upvotes: 0

Views: 636

Answers (1)

Juhani
Juhani

Reputation: 5108

You have to maintain your activity stack to make back button work correctly. Every time you don't want the user to get back to activity after he leaves it you should call finish() to that activity. It will remove it from activity stack.

In general activity stack management is bigger topic but a very important one. I really recommend reading this bit: http://developer.android.com/guide/practices/ui_guidelines/activity_task_design.html

Upvotes: 1

Related Questions