package com.contactlistviewactivity;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.provider.Contacts.People;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
/**
* A list view example where the data comes from a cursor.
*/
public class List7 extends ListActivity implements OnClickListener {
Button get;
TextView mPhone ;
private static String[] PROJECTION = new String[] {
People._ID, People.NAME, People.NUMBER
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_7);
mPhone = (TextView) findViewById(R.id.phone);
get=(Button) this.findViewById(R.id.Button01);
get.setOnClickListener(this);
//getListView().setOnItemSelectedListener(this);
// Get a cursor with all people
Cursor c = getContentResolver().query(People.CONTENT_URI, PROJECTION, null, null, null);
startManagingCursor(c);
//mPhoneColumnIndex = c.getColumnIndex(People.NUMBER);
ListAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_multiple_choice,
// that displays a
// text view
c, new String[] {People.NAME}, new int[] {android.R.id.text1}); // The "text1" view defined in
// the XML template
getListView().setTextFilterEnabled(true);
final ListView list=getListView();
list.setItemsCanFocus(false);
list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
setListAdapter(adapter);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
{
Intent intent = new Intent(this,contact.class);
intent.putExtra("selected",PROJECTION);
startActivity(intent);
}
}
/* public void onItemSelected(AdapterView parent, View v, int position, long id) {
if (position >= 0) {
Cursor c = (Cursor) parent.getItemAtPosition(position);
mPhone.setText(c.getString(mPhoneColumnIndex));
}
}
public void onNothingSelected(AdapterView parent) {
mPhone.setText(R.string.list_7_nothing);
}*/
}
I have run this project but i need i m click get button that time selected particular list Item go to set next layout please help me sir..source code give to me..



