Note that there are some explanatory texts on larger screens.

plurals
  1. POBack Image Button is not Clickable?
    text
    copied!<p>I have my layout xml file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/screen_background"&gt; &lt;ImageButton android:id="@+id/back_btn" android:layout_width="30dp" android:layout_height="190dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="-5dp" android:background="@drawable/button_movielist_back" /&gt; &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" android:layout_alignBottom="@+id/linearLayout01" android:layout_marginBottom="55dp"&gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="50dp" android:src="@drawable/tone_movies_banner" android:layout_alignParentTop="true" android:scaleType="fitXY"/&gt; &lt;HorizontalScrollView android:id="@+id/horizontalScroll" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;LinearLayout android:id="@+id/linearLayout3" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;Button android:id="@+id/actionBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/button_action_movies" android:onClick="btnClicker"/&gt; &lt;Button android:id="@+id/comedyBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/button_comedy_movies" android:onClick="btnClicker" /&gt; &lt;Button android:id="@+id/loveBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/button_love_movies" android:onClick="btnClicker" /&gt; &lt;/LinearLayout&gt; &lt;/HorizontalScrollView&gt; &lt;LinearLayout android:id="@+id/linearLayout01" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_marginBottom="5dp"&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>The BackButton image i am trying to set from the layout is:</p> <pre><code>&lt;ImageButton android:id="@+id/back_btn" android:layout_width="30dp" android:layout_height="190dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="-5dp" android:background="@drawable/button_movielist_back" /&gt; </code></pre> <p>code:</p> <pre><code>// Previous Button ImageButton backBtn = (ImageButton) findViewById(R.id.back_btn); backBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Toast.makeText(v.getContext(), "Hello!! button Clicked", Toast.LENGTH_SHORT).show(); //Intent i = new Intent(getBaseContext(), SpecificationsActivity.class); //i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); //ShortfilmCategoryviewActivity.this.startActivity(i); } }); </code></pre> <p>when i click on backimagebutton ,it is not clickable</p> <p>I think the problem persist in the layout xml file</p> <p>Could any one tell me placing of imagebutton is correct from my layout file?</p>
 

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