I use a TabActivityGroup to open a second activity inside the same tab. Now i want to go back to the previous activity (to the main activity) but finish(); causes a force close. In the parent class below, there is an id that is “myid” that refer the current activity being launched. i believe this is the key to navigate back to the previous activity. But how can i call an intent using this id in the SecondActivity.class. Someone run in a similar issue ? Please help and also i know i can use fragment, something alike but i am using a tabhost. i want the to know how to return back to Parent.class using intent from second activity. Thanks for those who answer my call.
Parent.class
Intent frequentMessages = new Intent(getParent(), FrequentMessageActivity.class);
TabGroupActivity parentActivity = (TabGroupActivity)getParent();
parentActivity.startChildActivity(“myid”, frequentMessages);
Just use fragments. Using Activities inside tabs is just wrong. This is not 2010 anymore. There isn’t any excuse for doing this in 2013.
To put it bluntly and quote somebody: “You’re holding it wrong.”. Hell, not wrong… completely wrong.