Problem invoking View Intent for Messaging App

by beachboy » Wed, 29 Apr 2009 15:04:20 GMT

Sponsored Links
 I am trying to view a message using the Messaging application on the
emulator. I created a message using Telnet and can see the message in
the Messaging App. I tried to invoke the view intent using the
following code. When this code runs the Messaging App starts but
displays the UI panel with the data as if I was a composing a message
rather than viewing the message.

  Uri uri = Uri.parse("sms:1234567890");
  Intent intent = new Intent(Intent.ACTION_VIEW,uri);
  intent.putExtra("sms_body", "testsmsmessage");
  intent.putExtra("compose_mode", false);

What am i doing wrong?


Other Threads

1. Retrieve HOME Contact Number from address book

hi guys,

currently i have a application which will retrieve all the contact
details and will display all the available Contact Names in a

so once user select a particular name number will be displayed. which
works fine.

but now i want to display HOME and WORK numbers if available. how can
i achieve this?

below is my class

public class ConL extends ListActivity {
        private SimpleCursorAdapter myAdapter;
        TextView stat;

        protected void onCreate(Bundle savedInstanceState) {
                // TODO Auto-generated method stub
                stat = (TextView) findViewById(;

        public void viewContacts() {
                Cursor cursor = getContentResolver().query(People.CONTENT_URI, 
                                null, null, People.NAME + " ASC");
                int x = cursor.getCount();
                if (cursor == null || x == 0) {
                        alert("Address Book", "Empty Address Book");
                String[] columns = new String[] { People.NAME };
                int[] names = new int[] { };
                myAdapter = new SimpleCursorAdapter(this, R.layout.test, cursor,
                                columns, names);

        public void alert(String header, String body) {
                new AlertDialog.Builder(this).setTitle(header).setMessage(body)
DialogInterface.OnClickListener() {

                                                        public void 
onClick(DialogInterface dialog,
which) {
                                                                // TODO 
Auto-generated method stub

        protected String[] isAssigned(String[] str) {
                String[] assign = null;
                for (int i = 0; i < str.length; i++) {
                        Cursor cur = managedQuery(People.CONTENT_URI, null, 
                                        + "='" + str[i] + "'", null, null);
                        if (cur != null) {
                                if (cur.moveToFirst()) {
                                        String title;
                                        // String phoneNumber;
                                        int nameColumn = 
                                        // int phoneColumn = 
                                        // String imagePath;
                                        do {
                                                // Get the field values

                                        } while (cur.moveToNext());
                return assign;

        protected void onListItemClick(ListView l, View v, int position, long
id) {
                // TODO Auto-generated method stub
                super.onListItemClick(l, v, position, id);
                Intent intent = new Intent(Intent.ACTION_CALL);
                // alert("TEst", 
                Cursor cursor = (Cursor) myAdapter.getItem(position);
                long phoneId = cursor.getLong(cursor
                Uri uri = ContentUris.withAppendedId(Phones.CONTENT_URI, 
                Cursor cur = managedQuery(uri, null, null, null, null);
                String phoneNumber = null;
                String primaryKey = null;
                if (cur.moveToFirst()) {
                        Constants.selectedName = cur.getString(cur
                        int phoneColumn = cur.getColumnIndex(People.NUMBER);
                        int type = cur.getColumnIndex(People._ID);
                        do {
                                // Get the field values
                                phoneNumber = cur.getString(phoneColumn);
                        } while (cur.moveToNext());

                Intent i = new Intent(ConL.this, CustomScreen.class);
                Bundle b = new Bundle();
       = phoneNumber;
                b.putString("Number", phoneNumber);



2. Putih-putih

si mbah ama cicit nya yawh?? ahahahahah :p

> Join:

3. Blapk Market down [again] ?

4. manage curosr in edit text...

5. Zoom 1 jari

6. How to get installed app size?

7. OOT Salam Kenal Semua