2011-10-07 44 views
-1

有人可以幫助我知道如何將圖像/音頻附加到我的應用程序中,此文件將發送到我的服務器。如何在Android中附加文件? (適用於傻瓜)

我認爲最簡單的方法是推出的Android安卓意圖,它顯示了我,就像我想的是支持的文件類型所有的應用程序,彈出..我想這給我的文件路徑。

我真的不明白這一點,請有人可以給我一個指導?謝謝。

回答

0

檢查了這一點:

/* Create the Intent */ 
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 

/* Fill it with Data */ 
emailIntent.setType("plain/text"); 
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"[email protected]"}); 
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject"); 
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text"); 

/* Send it off to the Activity-Chooser */ 
context.startActivity(Intent.createChooser(emailIntent, "Send mail...")); 

,然後看到這個帖子:

Trying to attach a file from SD Card to email

它應該幫助您瞭解如何創建真正進入連接東西電子郵件之前電子郵件的意圖。祝你好運。