Search in sources :

Example 1 with ErrorListener

use of org.wordpress.android.editor.EditorWebViewAbstract.ErrorListener in project WordPress-Android by wordpress-mobile.

the class EditPostActivity method onEditorFragmentInitialized.

@Override
public void onEditorFragmentInitialized() {
    fillContentEditorFields();
    // Set the error listener
    if (mEditorFragment instanceof EditorFragment) {
        mEditorFragment.setDebugModeEnabled(BuildConfig.DEBUG);
        ((EditorFragment) mEditorFragment).setWebViewErrorListener(new ErrorListener() {

            @Override
            public void onJavaScriptError(String sourceFile, int lineNumber, String message) {
                CrashlyticsUtils.logException(new JavaScriptException(sourceFile, lineNumber, message), T.EDITOR, String.format(Locale.US, "%s:%d: %s", sourceFile, lineNumber, message));
            }

            @Override
            public void onJavaScriptAlert(String url, String message) {
            // no op
            }
        });
    }
}
Also used : ErrorListener(org.wordpress.android.editor.EditorWebViewAbstract.ErrorListener) EditorFragment(org.wordpress.android.editor.EditorFragment) LegacyEditorFragment(org.wordpress.android.editor.LegacyEditorFragment) AztecEditorFragment(org.wordpress.android.editor.AztecEditorFragment) JavaScriptException(org.wordpress.android.JavaScriptException)

Aggregations

JavaScriptException (org.wordpress.android.JavaScriptException)1 AztecEditorFragment (org.wordpress.android.editor.AztecEditorFragment)1 EditorFragment (org.wordpress.android.editor.EditorFragment)1 ErrorListener (org.wordpress.android.editor.EditorWebViewAbstract.ErrorListener)1 LegacyEditorFragment (org.wordpress.android.editor.LegacyEditorFragment)1