Hi
I did get the values from selected contact details used check boxes.
But i used custom adapter for this to done.
I think that will easy to get the details... Try to that way because that
will easy get a child from listview..
On Wednesday, January 9, 2013 12:17:09 AM UTC+5:30, prudhvi wrote:
>
> i am new to android...... i was able to read the contacts in listview with
> checkboxes. I want to get the selected contacts data and have to send a
> message(sms) to selected contacts
>
> but don't know how to proceed further
>
> can anyone help me with that
>
> thanks in advance
>
> here is my code to read contacts
>
> public class MainActivity extends Activity {
> public ArrayList<Boolean> itemChecked = null;ArrayAdapter<String>
> myAdapterInstance;SimpleCursorAdapter adapter;String[] projection = new
> String[] { Phone._ID, Phone.DISPLAY_NAME,
> Phone.NUMBER };private static final Uri CONTACTS_URI =
> ContactsContract.Contacts.CONTENT_URI;@Overridepublic void onCreate(Bundle
> savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
> ADD = (Button) findViewById(R.id.button1);
> cancel = (Button) findViewById(R.id.button1);
> final Cursor cursor = managedQuery(Phone.CONTENT_URI, projection, null,
> null, Phone.DISPLAY_NAME + " ASC");
> final ListView lv = (ListView) findViewById(R.id.listView2);
> adapter = new SimpleCursorAdapter(this,
> R.layout.contactslist, cursor,
> new String[] { "display_name", Phone.NUMBER, "_id" },
> new int[] {
> R.id.textView11, R.id.textView12, R.id.checkBox1 }
>
> );
>
> lv.setAdapter(adapter);
> lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
> }
> @Overrideprotected void onDestroy() {
> super.onDestroy();
>
>
> how do i get the selected contacts to some cursor or adapter..........?
>
> <pre class="default prettyprint prettyprinted"
> style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:13.63636302947998px;vertical-align:baseline;backgrou...
> Show
> original<https://groups.google.com/group/android-developers/msg/98f23dcef6a4263a?dmode=source&output=gplain&noredirect>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en