简体   繁体   English

附加txt文件并发送到蓝牙

[英]Attach txt file and send to bluetooth

How i can send the txt file that i created with the FileOutputStream trought of screemShare 我如何发送使用screemShareFileOutputStream创建的txt文件

i can also not found the file path 我也找不到文件路径

//x = "/data/data/" + getPackageName() +"/pec.txt"; 

this is my code: 这是我的代码:

Intent intent = new Intent(android.content.Intent.ACTION_SEND);
        intent.setType("text/plain");
        Uri uri = Uri.parse(x);         

        intent.putExtra(android.content.Intent.EXTRA_STREAM, uri);
        intent.putExtra(android.content.Intent.EXTRA_TEXT, "PEC");

        startActivity(Intent.createChooser(intent,"Imprimir"));

检查此示例对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM