android - Clickable nested LinearLayout displaying AChartEngine dynamic graph -


i came across post exaplains if add android:onclick="onclickmethod" <linearlayout> in xml file, , in java file add

    public void onclickmethod(view v) {     intent intent= new intent(getapplicationcontext(), secondactivity.class);     startactivityforresult(intent, start_intent); } 

it should make linearlayout clickable. does. but, have following setup in xml file:

 <linearlayout      android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:layout_weight="1"     android:padding="0dp"     android:id="@+id/linearlayout1"     >     <linearlayout         android:layout_width="wrap_content"         android:layout_height="fill_parent"         android:layout_weight="1"         android:padding="5dp"         >     <imageview         android:id="@+id/imageview1"         android:src="@drawable/myicon"         android:gravity="center_vertical|center_horizontal"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:layout_weight="2"         />     <textview         android:id="@+id/textview1"         android:text="xxx"         android:gravity="center_vertical|center_horizontal"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:layout_weight="2"         android:textstyle="bold"         />     </linearlayout>     <linearlayout          android:id="@+id/mychart"          android:orientation="horizontal"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:layout_weight="1"          />  </linearlayout> 

if add android:onclick="onclickmethod" linearlayout1 makes textview , image clickable. ideally want graph clickable. tried adding android:onclick="onclickmethod" mychart linearlayout , did not make area clickable @ all.

btw, mychart linearlayout displays achartengine dynamic plot. , disabled x , y pans user cannot move graph around (renderer.setpanenabled(false, false)

please exaplain me doing wrong? want plot clickable. feel missing something.

thanks

in order add click interaction chart, have enable click interaction , add onclicklistener on chart view. can see working in this example, lines #156 #176.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -