1

I am encountering a new error for me when writing in any text field in webview.

Error message in log is :

11-19 16:40:48.063: E/AndroidRuntime(24912): java.lang.IllegalArgumentException: EditText cannot use the ellipsize mode TextUtils.TruncateAt.MARQUEE

My code for webview is :

public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
    int i = getArguments().getInt(ARG_PLANET_NUMBER);
    View rootView = (View) inflater.inflate(R.layout.webview, container,false);

    // String planet =
    // getResources().getStringArray(R.array.ns_menu_items)[i];
    String planet = getResources().getStringArray(R.array.Links)[i];

    mWebView = (WebView) rootView.findViewById(R.id.webview);

    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setSaveFormData(true);
    // mWebView.loadUrl("https://www.google.com/");

    mWebView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            mWebView.loadUrl(url);
            return true;
        }

        @Override
        public void onPageFinished(WebView view, String url) {
            if(mProgress.isShowing()) {
                mProgress.dismiss();
            }
        }
    });

    mProgress = ProgressDialog.show(getActivity(), "Loading", 
                                      "Please wait for a moment...");
    url = getResources().getStringArray(R.array.menu_links)[i];
    mWebView.loadUrl(url);
    getActivity().setTitle(planet);

    return rootView;
}

Any idea about this error. App crashes on any on click on any form element.

here is xml file :

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <!-- The main content view -->

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context=".MainActivity" >

    </RelativeLayout>

    <!-- The navigation drawer -->

    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <ListView
        android:id="@+id/drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#1BB1CC"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp" />

</android.support.v4.widget.DrawerLayout>

activity_main.xml :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/title_background"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

</RelativeLayout>

Webview.xml :

<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000000"
    android:gravity="center"
     >

</WebView>
6
  • As per your error message it shows "EditText cannot use the ellipsize mode". Are you using edittext in your xml layout? Commented Nov 19, 2013 at 11:23
  • Can you please post your xml file. Commented Nov 19, 2013 at 11:30
  • show your oncreate method of this fragment Commented Nov 19, 2013 at 11:33
  • sorry @QuokMoon, can you explain which method? Commented Nov 19, 2013 at 11:35
  • are you define onCreate method into fragment if then saw Commented Nov 19, 2013 at 11:37

1 Answer 1

1

Try adding this line

mWebView.setClickable(true);

after this line

mWebView = (Webiew) rootView.findViewById(R.id.webview);
Sign up to request clarification or add additional context in comments.

1 Comment

same problem, when I click on any field app crashes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.