2012-03-01 8 views
-1

このようなダイアログでテキストを共有する目的をどのように実装できますか?そこAndroid Shareインテント

enter image description here

+0

あなたはそれらのインテントを送信したいのですか? –

+6

この質問のタイトルを検索エンジンにコピーしました。さて、私が見つけたものを推測する?研究努力がない場合-1。 –

+0

私はそれらを送ってほしい –

答えて

4
Intent intent = new Intent(); 
intent.setAction(android.content.Intent.ACTION_SEND); 
intent.setType("text/plain"); 
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(filePath)); 
try 
{ 
    startActivity(Intent.createChooser(intent, "Sending File...")); 
} 
2

uは、次のとおりです。

Intent intent = new Intent(Intent.ACTION_SEND); 
intent.setType("text/plain"); 
intent.putExtra(Intent.EXTRA_TEXT, YOUR_TEXT_TO_SEND); 
startActivity(Intent.createChooser(intent, "Share with")); 
0

あなたはまた、私のライブラリAndroid Intentsを使用することができます。詳細については、デモアプリを参照してください