2010-08-27 70 views

回答

0

無論「發送圖像幕後」手段,推出在時間上延遲的動作,而用戶進一步的輸入,你可以使用下面的代碼:

// Need handler for callbacks to the UI thread 
    final Handler mHandler = new Handler(); 

    // Create runnable for posting 
    final Runnable doSomething = new Runnable() { 
     public void run() { 
      sendImageBehindScenes(); 
     } 
    }; 

    // launch doSomething after 2000 milliseconds 
    mHandler.postDelayed(doSomething , 2000); 

如果不回答你的問題,請重新說明。

+0

感謝您的回覆,讓我解釋一下我的場景,我想以編程方式發送mms。 Uri uri = Uri.fromFile(new File(imagePath)); \t Intent i = new Intent(Intent.ACTION_SEND); // \t i.setAction(Intent.ACTION_VIEW); \t i.setType(「image/jpeg」); i.putExtra(「sms_body」,autoMessage); \t i.putExtra(「address」,phoneNumber); \t i.putExtra(Intent.EXTRA_STREAM,uri); \t startActivity(i); 我是這樣做的。 但是,我再次獲取小部件發送彩信。所以,但我必須直接發送。 – Srinivas 2010-08-27 09:55:43

+0

請將此文字添加到問題中以便閱讀。我仍然沒有得到你想要的,但如果你想發送MMS檢查這個答案:http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in- android/2973016#2973016 – Maragues 2010-08-27 10:10:38

+0

我不想啓動消息應用程序。 MMS應在幕後發送。這裏是完整的故事: 在我的應用程序中,我必須自動響應傳入的短信,即;我的應用程序將發送圖像和消息。只需要能夠發送彩信而不需要用戶輸入。 – Srinivas 2010-08-27 10:24:03

1
Uri uri = Uri.fromFile(new File(imagePath)); 
     Intent i = new Intent(Intent.ACTION_SEND); 
//  i.setAction(Intent.ACTION_VIEW); 
     i.setType("image/jpeg"); 
     i.putExtra("sms_body", autoMessage); 
     i.putExtra("address", phoneNumber); 
     i.putExtra(Intent.EXTRA_STREAM, uri); 
     startActivity(i); 

這是我用來發送MMS,它的fire mms應用程序的代碼嗎?