diff --git a/shell/android-studio/reicast/src/main/assets/build b/shell/android-studio/reicast/src/main/assets/build index 28a55ddd6..97c87766d 100644 --- a/shell/android-studio/reicast/src/main/assets/build +++ b/shell/android-studio/reicast/src/main/assets/build @@ -1 +1 @@ -9891979f2c0e9e9e8a8975e16aea9b4e943bd3aa \ No newline at end of file +33a3f7638836bf2529902d1521f97e8a24e565b5 \ No newline at end of file diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/FileBrowser.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/FileBrowser.java index 06c8b739a..d35b4a6ec 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/FileBrowser.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/FileBrowser.java @@ -176,7 +176,7 @@ public class FileBrowser extends Fragment { if (!home.exists() || !home.isDirectory()) { showToastMessage(getActivity().getString(R.string.config_home), Snackbar.LENGTH_LONG); } else { - (new installGraphics()).execute(); + installButtons(); } if (!ImgBrowse && !games) { @@ -186,47 +186,38 @@ public class FileBrowser extends Fragment { } } - private class installGraphics extends AsyncTask { - @Override - protected String doInBackground(String... params) { - try { - File buttons = null; - String theme = mPrefs.getString(Config.pref_theme, null); - if (theme != null) { - buttons = new File(theme); - } - File file = new File(home_directory, "data/buttons.png"); - org.apache.commons.io.FileUtils.touch(file); - if (buttons != null && buttons.exists()) { - InputStream in = new FileInputStream(buttons); - OutputStream out = new FileOutputStream(file); - - // Transfer bytes from in to out - byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - in.close(); - out.close(); - } else if (!file.exists()) { - InputStream png = getActivity().getAssets().open("buttons.png"); - OutputStream fo = new FileOutputStream(file); - byte[] buffer = new byte[4096]; - int read; - while ((read = png.read(buffer)) != -1) { - fo.write(buffer, 0, read); - } - png.close(); - fo.flush(); - fo.close(); - } - } catch (FileNotFoundException fnf) { - fnf.printStackTrace(); - } catch (IOException ioe) { - ioe.printStackTrace(); + private void installButtons() { + try { + File buttons = null; + String theme = mPrefs.getString(Config.pref_theme, null); + if (theme != null) { + buttons = new File(theme); } - return null; + File file = new File(home_directory, "data/buttons.png"); + org.apache.commons.io.FileUtils.touch(file); + InputStream in = null; + if (buttons != null && buttons.exists()) { + in = new FileInputStream(buttons); + } else if (!file.exists()) { + in = getActivity().getAssets().open("buttons.png"); + } + if (in != null) { + OutputStream out = new FileOutputStream(file); + + // Transfer bytes from in to out + byte[] buf = new byte[4096]; + int len; + while ((len = in.read(buf)) != -1) { + out.write(buf, 0, len); + } + in.close(); + out.flush(); + out.close(); + } + } catch (FileNotFoundException fnf) { + fnf.printStackTrace(); + } catch (IOException ioe) { + ioe.printStackTrace(); } }