if (f.exists()) { f.delete(); } f.createNewFile(); FileOutputStream stream = new FileOutputStream(f); stream.write(msg.getBytes()); stream.flush(); stream.close(); return true; } catch (IOException ex) { Log.e("writeUpdateInfo()" + ex); return false; } } public static void showToast(final Activity activity, final String content) { activity.runOnUiThread(new Runnable() {