I want to set focusable and clickable mode for LinearLayout (like in above image). How to I make this?
Asked
Active
Viewed 567 times
0
-
try this myBtn.setFocusableInTouchMode(true); – Amitsharma Sep 18 '15 at 06:00
-
if you have need more then i will post here grt answer for custom all the things like theame – Amitsharma Sep 18 '15 at 06:00
-
Thats code isn't work – Taha Körkem Sep 18 '15 at 06:06
-
look at this link http://wptrafficanalyzer.in/blog/changing-background-color-and-border-color-of-an-edittext-widget-using-state-list-in-android/ – Amitsharma Sep 18 '15 at 08:01
2 Answers
1
try this, it worked for me
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground">
</LinearLayout>

Jack Wilsdon
- 6,706
- 11
- 44
- 87

Hernan Bruno
- 26
- 1
0
In the XML file that you defined, you can have in your element:
android:focusable="true"
or
android:clickable="true"

heavyweight
- 88
- 2
- 8