public void showSwitchStorageDialog( final ActivityRequestCode requestCode, boolean useExternalStorageNew) { this.mUseExternalStorageNew = useExternalStorageNew; DialogFactory.showYesCancelDialog( parentActivity, R.string.dialog_title_external_storage, useExternalStorageNew ? R.string.summary_preference_storage_external_on : R.string.summary_preference_storage_external_off, requestCode); }
// This is in the UI thread, so we can mess with the UI @Override protected void onPostExecute(TaskResult result) { DialogFactory.dismissSafely(dlg); if (result == null) { MyLog.e(this, "Result is Null"); return; } MyLog.d( this, this.getClass().getSimpleName() + " ended, " + (result.success ? (result.moved ? "moved" : "didn't move") : "failed")); if (!result.success) { result.messageBuilder.insert(0, mContext.getString(R.string.error) + ": "); } Toast.makeText(mContext, result.getMessage(), Toast.LENGTH_LONG).show(); parentActivity.showUseExternalStorage(); }
@Override protected void onCancelled(TaskResult result) { DialogFactory.dismissSafely(dlg); }