I am creating a chat application & for that purpose i have used TabHost.
In that first tab contains List of Buddies, and as soon as user clicks on any of the buddy
from buddy it should create another tab for that buddy in order to chat.
I am completed up to this but my problem is I am using a single Activity to perform Chat
but It always shows the same activity for each buddy.
Any Help will be highly appreciated. Here is my code,
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
RosterEntry entry = List.get(position);
String userName = entry.getName();
Intent intent = new Intent().setClass(RosterScreen.this,
com.spotonsoft.chatspot.ui.ChatScreen.class);
TabSpec tabSpec = Home.tabHost.newTabSpec("chat")
.setIndicator(userName).setContent(intent);
Home.tabHost.addTab(tabSpec);
}
Best Regards,
~Anup
in onCreate of ChatScreen you only setup basic stuff like getting View and store it in private fields
onResume you “recreate” ChatScreen with buddy-specific data … how to do this (pls, read comments in code)?
and your code