Hey Pramod,
just add  this line

 getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

On Fri, Oct 8, 2010 at 4:39 PM, pramod.deore <deore.pramo...@gmail.com>wrote:

> Here is my .java file
>
> import android.app.ListActivity;
> import android.os.Bundle;
> import android.view.View;
> import android.widget.ArrayAdapter;
> import android.widget.CheckBox;
> import android.widget.ListView;
> import android.widget.Toast;
>
> public class MyList extends ListActivity {
>
>        /** Called when the activity is first created. */
>        public void onCreate(Bundle icicle) {
>                super.onCreate(icicle);
>                // Create an array of Strings, that will be put to our
> ListActivity
>                String[] names = new String[] { "Linux", "Windows7",
> "Eclipse",
> "Suse", "Ubuntu", "Solaris", "Android", "iPhone"};
>                // Create an ArrayAdapter, that will actually make the
> Strings above
>                // appear in the ListView
>                this.setListAdapter(new ArrayAdapter<String>(this,
>
>  android.R.layout.simple_list_item_multiple_choice, names));
>        }
>
>        @Override
>        protected void onListItemClick(ListView l, View v, int position,
> long
> id) {
>                super.onListItemClick(l, v, position, id);
>                // Get the item that was clicked
>                Object o = this.getListAdapter().getItem(position);
>                String keyword = o.toString();
>                Toast.makeText(this, "You selected: " + keyword,
> Toast.LENGTH_LONG)
>                                .show();
>
>
>        }
> }
>
>
> and xml file is just auto generated main.xml file.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Thanks & Regards

Rakesh Kumar Jha
Software Developer
Symphony Services Corp (India) Pvt Ltd
Bangalore
(O) +918030274295
(R) +919886336619

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to