Table View in Android
I am developing an application in Android. I need the table view functionality as in iOS. iOS Table View has a selection functionality. How to implement this functionality in Android?
I have created a list view on one of the tabs with the list populated from an array but now on the particular list item click I want to load the new class and also have to perfo开发者_StackOverflow社区rm new activity please guide me for this. here is my code
thanx in advance
I don't know what a table view is on the iphone, but it sounds like a TabHost will do what you want. Take a look at the Tab Layout tutorial.
If you are using the List you need to add OnItemClickListener with the ListView object.
In the method you can start new activity e.g
public void onItemClick(AdapterView<?> listView, View v, int position, long id) {
Intent n = new Intent(CurrentActivity.this, MyNewActivity.class);
//You can pass data to new activity if any
//n.putExtra("data", "This is my data");
startActivity(n);
}
精彩评论