Commit 5530a3a5 authored by fallenstardust's avatar fallenstardust

fix文件已存在时覆盖空文件

parent c59b4627
......@@ -215,6 +215,9 @@ public class GameUriManager {
try {
File yrp = new File(AppsSettings.get().getResourcePath() + "/" + CORE_REPLAY_PATH + "/" + urifile.getName().toLowerCase(Locale.US));
ParcelFileDescriptor pfd = getActivity().getContentResolver().openFileDescriptor(uri, "r");
if (yrp.exists()) {
YGOStarter.startGame(getActivity(), null);
} else {
if (pfd == null) {
return;
} else {
......@@ -226,14 +229,15 @@ public class GameUriManager {
pfd.close();
}
}
}
} catch (Throwable e) {
e.printStackTrace();
}
}
if (!ComponentUtils.isActivityRunning(activity, new ComponentName(activity, YGOMobileActivity.class))) {
YGOStarter.startGame(activity, null);
Toast.makeText(activity, activity.getString(R.string.yrp_installed), Toast.LENGTH_LONG).show();
}
}
} else {
String host = uri.getHost();
// if (!Constants.URI_HOST.equalsIgnoreCase(host)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment