代码如下:private void open(String fileString) { Intent intent = new Intent(); int
代码如下:
private void open(String fileString) {
Intent intent = new Intent();
intent.setClassName("com.rarlab.rar", "com.rarlab.rar.MainActivity");
File file = new File(fileString);
Uri data = Uri.fromFile(file);
intent.setData(data);
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
try {
Uri uri = Uri.parse("market://search?q=" + "rar");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
} catch (ActivityNotFoundException e2) {
Log.i(TAG, "market no found");
}
}
}
--结束END--
本文标题: android打开rar压缩文件
本文链接: https://lsjlt.com/news/27181.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0