2011-11-03 27 views
0

我想調用消息撰寫屏幕&從我的應用程序調用。我寫了下面的代碼。請幫我要進入郵件撰寫屏幕..想要從我的應用程序進入消息撰寫屏幕

public void onClick(DialogInterface dialog, int which) { 
      // TODO Auto-generated method stub 
     switch (which) { 
     case 0:{ 
      Intent callIntent = new Intent(Intent.ACTION_CALL); 
      callIntent.setData(Uri.parse("tel:" + bean.getPhoneno())); 
      startActivity(callIntent); 
     }break; 
     case 1 :{ 




     }break; 
     } 

       } 
      });enter code here 

回答

0

朋友,我得到了這樣一個更好的方式 - :

Intent intent = new Intent(Intent.ACTION_SENDTO, 
      Uri.fromParts("sms", phone_number, null)); 
      startActivity(intent); 
1

試試這個,

 Intent sendIntent = new Intent(Intent.ACTION_VIEW); 
     sendIntent.putExtra("sms_body", "Content of the SMS goes here..."); 
     sendIntent.setType("vnd.android-dir/mms-sms"); 
     startActivity(sendIntent); 

String number = "12345678"; 
startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null))); 
+0

感謝所有爲你解答。我還有另外一個方法來做到這一點 - : – Vinay

1

要打開本地短信作曲家:

String number = "12346556"; // The number on which you want to send SMS 
20 
startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null))); 

OR

Uri uri = Uri.parse("smsto:12346556"); 
Intent it = new Intent(Intent.ACTION_SENDTO, uri); 
it.putExtra("sms_body", "Here you can set the SMS text to be sent"); 
startActivity(it); 

更多信息:Sending SMS example

相關問題