Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Experimentation for Engineers: From A/B testing to Bayesian optimization
this week in the
Design
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
how to call button inside a slidingDrawer
shawn peter
Ranch Hand
Posts: 1325
1
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
below is my clidingDrawer
slideHandleButton = (Button) findViewById(R.id.slideHandleButton); slidingDrawer = (SlidingDrawer) findViewById(R.id.SlidingDrawer); slidingDrawer.setOnDrawerOpenListener(new OnDrawerOpenListener() { public void onDrawerOpened() { slideHandleButton.setBackgroundResource(R.drawable.openarrow); } }); slidingDrawer.setOnDrawerCloseListener(new OnDrawerCloseListener() { public void onDrawerClosed() { slideHandleButton.setBackgroundResource(R.drawable.closearrow); } }); [code] below is my xml [cdoe] <LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="bottom" > <SlidingDrawer android:layout_width="wrap_content" android:id="@+id/SlidingDrawer" android:handle="@+id/slideHandleButton" android:content="@+id/contentLayout" android:padding="10dip" android:layout_height="250dip"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/slideHandleButton" android:background="@drawable/closearrow"></Button> <LinearLayout android:layout_width="wrap_content" android:id="@+id/contentLayout" android:orientation="vertical" android:gravity="center|top" android:padding="10dip" android:background="#C0C0C0" android:layout_height="wrap_content"> <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Content"></Button> <Button android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Content"></Button> <Button android:layout_marginLeft="-3dip" android:textColor="#FFFFFF" android:layout_width="100dp" android:textStyle="bold" android:layout_height="wrap_content" android:text="@string/satalite" android:id="@+id/B_Satilite"></Button> </LinearLayout> </SlidingDrawer> </LinearLayout>
I need to call B_Satilite.Normally we call button as below.
Button satalite=(Button)findViewById(R.id.B_Satilite); satalite.setOnClickListener(this);
I need to know how to select one button inside SlidingDrawer and how to call ?
And then the flying monkeys attacked. My only defense was this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
odd framelayout/surfaceview problem
Is it not possible to have multiple horizontal scroll texts in an Single Screen??
nullpointer when i try to initiate onclicklistener
how to put layout in middle of the screen?
Create Custom List
More...