Android

关注公众号 jb51net

关闭
首页 > 软件编程 > Android > android打开压缩文件

android打开rar压缩文件

作者:

这篇文章主要介绍了android打开rar压缩文件示例,调用RAR for 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");
  }
 }
}

您可能感兴趣的文章:
阅读全文