android打开rar压缩文件

前端技术 2023/09/03 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\");
  }
 }
}

本文地址:https://www.stayed.cn/item/6319

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。