mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-02 02:04:48 +12:00
check rom file is valid or not
This commit is contained in:
parent
b256c89e23
commit
9a70060644
1 changed files with 4 additions and 0 deletions
|
@ -48,6 +48,10 @@ public class GamesFragment extends Fragment implements ActivityResultCallback<Ur
|
||||||
public void onActivityResult(Uri result) {
|
public void onActivityResult(Uri result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
String uri = result.toString();
|
String uri = result.toString();
|
||||||
|
if (!uri.endsWith(".3ds") && !uri.endsWith(".cia")) {
|
||||||
|
Toast.makeText(getContext(), "Invalid ROM file", Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (GameUtils.findByRomPath(uri) == null) {
|
if (GameUtils.findByRomPath(uri) == null) {
|
||||||
if (FileUtils.obtainRealPath(uri) == null) {
|
if (FileUtils.obtainRealPath(uri) == null) {
|
||||||
Toast.makeText(getContext(), "Invalid file path", Toast.LENGTH_LONG).show();
|
Toast.makeText(getContext(), "Invalid file path", Toast.LENGTH_LONG).show();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue