0

I am New to Android. My Requirement is to check an item of list view and i want show the selected items in next activity.

can anyone help me..

2 Answers2

0

Refer this to work with listview

Then you can pass that value to you next activity by

lv.setOnItemClickListener(new OnItemClickListener() {
    public void onItemClick(AdapterView<?> parent, View view,
        int position, long id) {
           String s = ((TextView) view).getText().toString()  ;//get the string 
             Intent i = new Intent(CurrentActivity.this, NextActivity.class);
              i.putExtra("packageName.term", s; //attach you value 
              startActivity(i); //start activity  
    }
  });

from NextActivity you can read this by

Bundle extras = getIntent().getExtras();
 String term = extras.getString("packageName.term"); //read that value 
Labeeb Panampullan
  • 34,521
  • 28
  • 94
  • 112
0

see this example for listView with check-boxes: http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/

In order to "move" the selected items to the new activity, you can use the traditional way of transferring data between activities - see this: In Android: How do I get variables/data from one screen to another?

or if you want to move a complex object, the most simple way would be to create a singleton object and use it as a "transporter".

Community
  • 1
  • 1
Asaf Pinhassi
  • 15,177
  • 12
  • 106
  • 130