Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess the content form customview in android
    text
    copied!<p>I am using the customview to add a xml in my Actionbar in ICS..Here is the code...I want to access the xml contents</p> <pre><code> ActionBar actionBar = getActionBar(); actionBar.show(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); actionBar.setCustomView(R.layout.abc); </code></pre> <p>In that view i have 2 button and a textview...Now i want to access those button in onclick...</p> <p>Here is the xml : </p> <p>abc.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="Button" /&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:text="Delosis V2" android:textSize="6.5pt" android:paddingTop="15dp" /&gt; &lt;Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:text="Button" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Now any solution please.... </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