I'm wanting to see which tab is selected and execute specific code based on that selection. I've used the following tutorial to create the list with images and the problem is the list items are in separate tabs and the code I followed only sets the images for the first tab.
http://www.debugrelease.com/2013/06/24/android-listview-tutorial-with-images-and-text/
Here's how I've set up the tabs.
TabHost tabHost = getTabHost();
//Tab for Students
TabSpec studentSpec = tabHost.newTabSpec("Students");
//set the tile and icon
studentSpec.setIndicator("Students", getResources().getDrawable(R.drawable.icon_students));
Intent songsIntent = new Intent(this, StudentsTab.class);
studentSpec.setContent(songsIntent);
//Tab for Support
TabSpec supportSpec = tabHost.newTabSpec("Support");
//set the tile and icon
supportSpec.setIndicator("Support", getResources().getDrawable(R.drawable.icon_support));
Intent videosIntent = new Intent(this, SupportTab.class);
supportSpec.setContent(videosIntent);
//tabHost.addTab(homeSpec);
tabHost.addTab(studentSpec);
tabHost.addTab(supportSpec);
}
So I have two methods in the Model.java class from the tutorial, each that runs the appropriate icons and text. I need these to be called on a specific tab.
Thank you!