Open SMS Activity

Put your problem here if it does not fit any of the other categories.

Open SMS Activity

Postby Alen » Tue May 26, 2009 9:50 am

Hi,
how to open the native SMS Activity just like the click on sms/mms ICON!

with:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. Intent defineIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:#"));
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

opens the Activity for new SMS.

But i want to show the inbox.
i have tried content://sms/inbox/ but it happens nothing.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent defineIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("content://sms/inbox/"));
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


olso sms:inbox does the sam like sms:#

Thx.
Alen
Alen
Freshman
Freshman
 
Posts: 8
Joined: Tue Mar 17, 2009 12:54 pm

Top

Postby Alen » Tue May 26, 2009 1:49 pm

i got the soulution:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.           //=========================================
  3.  
  4.             // START NEW INTENT SMS INBOX
  5.  
  6.             //=========================================
  7.  
  8.             String SMS_MIME_TYPE = "vnd.android-dir/mms-sms";
  9.  
  10.             Intent defineIntent = new Intent(Intent.ACTION_MAIN);                
  11.  
  12.             defineIntent.setType(SMS_MIME_TYPE);                
  13.  
  14.             // should I be using FLAG_ACTIVITY_RESET_TASK_IF_NEEDED??                
  15.  
  16.             int flags = Intent.FLAG_ACTIVITY_NEW_TASK |
  17.  
  18.                                 Intent.FLAG_ACTIVITY_SINGLE_TOP |          
  19.  
  20.                                 Intent.FLAG_ACTIVITY_CLEAR_TOP;                
  21.  
  22.             defineIntent.setFlags(flags);
  23.  
  24.            
  25.  
  26.             PendingIntent pendingIntent = PendingIntent.getActivity(context, 0 /* no requestCode */, defineIntent, 0 /* no flags */);
  27.  
  28. ..
  29.  
  30. .
  31.  
  32. .
  33.  
  34.  
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
Alen
Freshman
Freshman
 
Posts: 8
Joined: Tue Mar 17, 2009 12:54 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests