• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps how to show another List View

soclose

Lurker
Hi

I'd like to show another List View 'B' after clicking a item of List View 'A'. I use onListItemClick event in Android 1.6 project.

Code:
public void onListItemClick(
            ListView parent, View v,
            int position, long id) 
            {   
                Toast.makeText(this, 
                    "You have selected " + lv_arr[position], 
                    Toast.LENGTH_SHORT).show();
            }
how to code it? :confused:
 
You can launch a new activity and show the new list there.

public void onListItemClick( ListView parent, View v, int position, long id)
{
final Intent i = new Intent(this, NewListActivity.class);
startActivity(i);
}
 
I got 'Source not found' error.

Code:
public void onListItemClick(
            ListView parent, View v,
            int position, long id) 
            {   
                final Intent i = new Intent(this, WLView.class);
                startActivity(i);
            }

how to solve?:(
 
Back
Top Bottom