How to transfer intent from TabActivity to its child activity

I need help:)

I have a tab with four helper actions. The first and most important is the activity of the list, the second is also the list, the third is the activity of the settings, and the fourth is with.

When the application starts, the activity of the tabs creates specifications with intentions for auxiliary operations and sets the first activity as the current tab, so the action acts on the intent from the specification and works fine. Later, the broadcast receiver may send a notification with the intention of updating the activity of the first list as new data has appeared.

My goal: when the user acts after the notification: if the application is running, then there is a task in the stack, but not from the top, to update the current activity of the list inside the tab and bring the entire application to the foreground. If the application is already visible, but on a different sub-activity (different tabs), just go to the first tab and refresh the first list. If the first list (first tab) is already displayed only for updating it.

I can not do this job. I tried different strategies. A target that is intended for tabulation activity. Intention target sub-activity. Combinations of launchMode flags and intentions, but I can't do this work. It seems to me that this is a reasonable scenario.

Any insight would be appreciated.

+4
source share
1 answer

OK this workaround worked for me:

TabActivity has an onNewIntent (...) method that handles the intentions that I want to pass to the child activity. TabActivity will call the method on the user object of the application. This object will convey a ChildActivity message, which passed it as a listener in the application object at creation.

+1
source

All Articles