Note that there are some explanatory texts on larger screens.

plurals
  1. POImageView onClickListener is not working
    text
    copied!<p>I have two ImageViews, one text field and one WebView in a LinearLayout. My ImageView listener is not working. Here is my XML:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_main" android:orientation="vertical" &gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="back" android:adjustViewBounds="true" android:clickable="true" android:src="@drawable/back_icon" /&gt; &lt;ImageView android:id="@+id/imageView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:clickable="true" android:contentDescription="forward" android:src="@drawable/back_icon"/&gt; &lt;EditText android:id="@+id/adressBar" android:imeOptions="actionDone" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ems="10" &gt; &lt;/EditText&gt; &lt;WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>Here is my Java code. I should point out that the Log.d statement is not firing, so it is definitely not getting called:</p> <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (savedInstanceState == null) { L.d("&gt;&gt;onCreateView", "savedInstanceState null"); } View v = inflater.inflate(R.layout.browser,null); mWebView = (WebView) v.findViewById(R.id.webView); back =(ImageView) v.findViewById(R.id.imageView1); back.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.d("backkkkkkkkkkkkkkkk", "msg"); } }); return v; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload