use of com.amaze.filemanager.asynchronous.asynctasks.WriteFileAbstraction in project AmazeFileManager by TeamAmaze.
the class TextEditorActivity method saveFile.
/**
* Method initiates a worker thread which writes the {@link #mInput} bytes to the defined
* file/uri 's output stream
*
* @param editTextString the edit text string
*/
private void saveFile(final String editTextString) {
Toast.makeText(this, R.string.saving, Toast.LENGTH_SHORT).show();
new WriteFileAbstraction(this, getContentResolver(), mFile, editTextString, cacheFile, isRootExplorer(), (errorCode) -> {
switch(errorCode) {
case WriteFileAbstraction.NORMAL:
mOriginal = editTextString;
mModified = false;
invalidateOptionsMenu();
Toast.makeText(getApplicationContext(), getString(R.string.done), Toast.LENGTH_SHORT).show();
break;
case WriteFileAbstraction.EXCEPTION_STREAM_NOT_FOUND:
Toast.makeText(getApplicationContext(), R.string.error_file_not_found, Toast.LENGTH_SHORT).show();
break;
case WriteFileAbstraction.EXCEPTION_IO:
Toast.makeText(getApplicationContext(), R.string.error_io, Toast.LENGTH_SHORT).show();
break;
case WriteFileAbstraction.EXCEPTION_SHELL_NOT_RUNNING:
Toast.makeText(getApplicationContext(), R.string.rootfailure, Toast.LENGTH_SHORT).show();
break;
}
}).execute();
}
use of com.amaze.filemanager.asynchronous.asynctasks.WriteFileAbstraction in project AmazeFileManager by TeamAmaze.
the class TextEditorActivity method saveFile.
/**
* Method initiates a worker thread which writes the {@link #mInput} bytes to the defined file/uri
* 's output stream
*
* @param editTextString the edit text string
*/
private void saveFile(final String editTextString) {
Toast.makeText(this, R.string.saving, Toast.LENGTH_SHORT).show();
new WriteFileAbstraction(this, getContentResolver(), mFile, editTextString, cacheFile, isRootExplorer(), (errorCode) -> {
switch(errorCode) {
case WriteFileAbstraction.NORMAL:
mOriginal = editTextString;
mModified = false;
invalidateOptionsMenu();
Toast.makeText(getApplicationContext(), getString(R.string.done), Toast.LENGTH_SHORT).show();
break;
case WriteFileAbstraction.EXCEPTION_STREAM_NOT_FOUND:
Toast.makeText(getApplicationContext(), R.string.error_file_not_found, Toast.LENGTH_SHORT).show();
break;
case WriteFileAbstraction.EXCEPTION_IO:
Toast.makeText(getApplicationContext(), R.string.error_io, Toast.LENGTH_SHORT).show();
break;
case WriteFileAbstraction.EXCEPTION_SHELL_NOT_RUNNING:
Toast.makeText(getApplicationContext(), R.string.root_failure, Toast.LENGTH_SHORT).show();
break;
}
}).execute();
}
Aggregations