ScrollableTabHost-for-Android icon indicating copy to clipboard operation
ScrollableTabHost-for-Android copied to clipboard

Problem in child ActivityGroup

Open fuadhamidan opened this issue 14 years ago • 1 comments

I had a problem in ActivityGroup... This problem arises when I use Scrolllable Tabhost... when I use TabHost, everything went smoothly...

problem in childActivity... when I press back in childActivity, did not return to mainActivity... but out of the application, just like when pressing back in mainActivity...

if you have a solution for my problem?

Regards, Vootsugu

fuadhamidan avatar Mar 30 '11 11:03 fuadhamidan

I had the same problem, depending on the type of activity shown (esp. as far as I understood if it is focusable in touchmode). In my Main activity deriving from ScrollableTabActivity I keep track of the Activities being in the Tabs and the dispatchKeyEvent is overwritten:

public boolean dispatchKeyEvent(KeyEvent event) {
    int currentTab = getCurrentTab();
    return activityList[currentTab].dispatchKeyEvent(event);
}

This way all key events end up at the Activity of ActivityGroup currently being show. Of course you need to handle the key event in your these activities...

Cheers, Eyck

eyck avatar Apr 14 '11 07:04 eyck