I have a ListView. When I select an item in the ListView, I would like to have a Subview slide in from the right, the way that it does in many Apps.
I have been searching for tutorials on this topic but am spinning my wheels. Maybe Android uses a term different than “Subview” ?
Here’s what I ended up doing:
-
Create a New Class for the SubView
-
Add the Subview class to the Manifest with
<activity android:name=".SubViewClassName" />inside the<application>tag -
Add this to the main Class (“lv” is the ListView)
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent,
View view,int position, long id) {Intent myIntent = new Intent(view.getContext(),SubView.class); startActivityForResult(myIntent, 0); }});
The simplest thing is to have your second
ListViewbe in a separateActivity. If the user has inter-activity animations enabled (and that is the default), then your secondListViewwill slide in from the right.