tags:

views:

54

answers:

2

Hi All,

i have a list view with 15 items. when i click on any item i want to change the screen(Intent). how can i change the activity on item selected in android? any tutorial or source code?

thanks in advance.

A: 

Check the selected answer in http://stackoverflow.com/questions/2367936/listview-onitemclicklistener-not-responding

If you also need code examples to change activity, head to http://developer.android.com/intl/fr/guide/index.html and start reading.

                // Prepare intent
                Intent newActivity = new Intent(this, NewActivity.class);

                // start activity
                startActivity(newActivity);
Maragues
A: 

You can use ListView's setOnItemClickListener, and start an new Activity in your implementation of this method. Following is sample code:

getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
    public void onItemClick(AdapterView parent, View v, int position, long id){
        // Start your Activity according to the item just clicked.
    }
};)
Tony