tags:

views:

46

answers:

1

Hi,

How would i remove the focus from an activity which has just being installed/started,

so the user's focus will remine on the previouse one? (while the new activity remine in the stack and will work in the background)

the prob is that when i start this new background activity, until i wont press back or home, the ui is stuck. and i would like to fix that some how

thanks,

ray.

+1  A: 

Call finish(), and your activity will be destroyed and the previous activity on the activity stack will be brought to the foreground.

CommonsWare
Yes, but the prob is that in this activity i have BroadcastReceiver and also implemented onActivityResult.. stuff which wont be available later when i do finish(); any other idea?
rayman
`onActivityResult()` will only matter if you have just called `startActivityForResult()`, and in that case, you don't have the foreground, anyway. So that is irrelevant with respect to your question. Move your `BroadcastReceiver` to a `Service` or register it in the manifest, so it is available regardless of whether your activity is in the foreground.
CommonsWare
yes, but if i do wanna use startActivityForResult() of this activity.. i wont be able to do it. coz it's already got finish().
rayman
What you want is impossible, then.
CommonsWare
SO You say there is no way to install/start an activity and avoid of it being as the 'root-acitivty' in the stack ah?
rayman
"You say there is no way to install/start an activity and avoid of it being as the 'root-acitivty' in the stack" -- that has nothing to do with anything else you have in this question.
CommonsWare
I`am sorry if i didnt write my question right.. ill re-edit it.
rayman