I have a tabbed activity as my main class and 3 activities that it has as tabs.

I've been googleing this but no luck so far. One of my activities has a thread that runs and gets messages from the telnet thread via a queue. Without going into that to much essentially the issue is sometimes the board activity realizes a game has started and creates a new board, but the person may not be viewing the board tab, he may be in the console tab reading new chat messages, and what I'm trying to do is switch him to the board tab when a game starts. See he can send a request for a game and be waiting for someone to respond, and be watching the new chat in the console view rather than being in his board view, but ideally i want to switch him to the board activity on new game.

Mike

i figured this out. the tabhost variable you create when creating your tabs can be used later with the method setCurrentTab(int), where first tab is 0 second tab is 1 etc.

It's still tricky because if you have an event you need to notify the active tab, if the tab you want active is not active, to call the method. So with 3 tabs ( 0,1,2) if it's not on 1 when the event comes in from telnet, i need to send a message to tab 0 or 2 depending on what is active and have them call setCurrentTab(int).

Mike

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.