Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the Following Code, your problem will be solve. </p> <p> </p> <pre><code>&lt;Button android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignBottom="@+id/foreground" android:layout_alignLeft="@+id/foreground" android:layout_alignRight="@+id/foreground" android:layout_alignTop="@+id/foreground" android:background="@android:drawable/dialog_frame" android:onClick="clickedMe" /&gt; &lt;RelativeLayout android:id="@+id/foreground" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentTop="true" &gt; &lt;TextView android:id="@+id/button_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="112dp" android:text="@string/hello_world" /&gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/button_text" android:layout_centerHorizontal="true" android:paddingBottom="10dip" android:paddingTop="10dip" android:src="@drawable/ic_launcher" /&gt; &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p><strong>------------- EDIT --------------------</strong></p> <p>oNclick Method: </p> <pre><code>final TextView text = (TextView) findViewById(R.id.button_text); RelativeLayout foreground = (RelativeLayout) findViewById(R.id.foreground); foreground.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "clicked"); Toast.makeText(getApplicationContext(), "Clicked...!!!", Toast.LENGTH_LONG).show(); text.setTextColor(Color.RED); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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