如何实现一个意向共享一些文本的对话是这样?
解决方案
意向意图=新的意图();
intent.setAction(android.content.Intent.ACTION_SEND);
intent.setType(text / plain的);
intent.putExtra(Intent.EXTRA_STREAM,Uri.parse(文件路径));
尝试
{
startActivity(Intent.createChooser(意向,正在发送文件...));
}
How can implement an intent for sharing some text in a dialog like this ?
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..."));
}
上一篇:将指向局部变量的指针传递给函数:它安全吗?指针、变量、局部、函数
下一篇:Android Activity Stack 未按文档中的说明工作 - 未显示任务堆栈中的最后一个活动堆栈、未按、任务、文档