html5中文学习网

您的位置: 首页 > android » 正文

android打开rar压缩文件_Android_脚本之家

[ ] 已经帮助:人解决问题

复制代码 代码如下:

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");
  }
 }
}

(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助