Thanks for the greate help. But now i want to display list of strings.
This code is helpful for converting the sms to string insteade of
adapter.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import android.app.Activity;
import android.app.ListActivity;
import android.content.ContentUris;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.provider.Telephony.Carriers;

import android.telephony.gsm.SmsMessage;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;

public class tele extends ListActivity {


     // Button ms1;
      /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);

        //ms1=(Button)findViewById(R.id.ms1);
        Uri uri = Uri.parse("content://sms/inbox");
        Cursor c= getContentResolver().query(uri, null, "body like '%s
%'",null,null);

       // Cursor c = getContentResolver().query(Carriers.CONTENT_URI,
null, null, null, null);
        startManagingCursor(c);

        if(c.getCount() !=0)
        {
                    String[] str = new String[c.getCount()];
                    int i = 0;
                    if(c.moveToFirst())
                    {
                        do
                        {

                                str[i] = (c.getString
(c.getColumnIndexOrThrow("body"))).toString();

                                i++;

                        }while(c.moveToNext());



                    }
/////////////////////////////////////////////////////////////////
                    new ArrayAdapter<String>(this,
                                R.id.row_entry,
                                str);
  ///////////////////////////////////////////////////////////////////////
        }

    }



}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Please help me how can i display the list of strings. I want to
display String[] str. Kindly remember i have to search the strings .
So want the list of strings not the listadapter.
Thanks a lot in advance.
--~--~---------~--~----~------------~-------~--~----~
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