Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android clickable layout

Tags:

People also ask

Can a layout be clickable in Android?

You can make a view clickable, as a button, by adding the android:onClick attribute in the XML layout.

What does clickable do in Android?

clickable seems to be useful when you need a view to consume clicks so that they do not go to views beneath the top view. For example, I have a FrameLayout that I display over an underlying RelativeLayout at certain times. When the user would click on an underlying EditText the focus would shift to that EditText .

How to make image button clickable in android studio?

2 Answers. Show activity on this post. Remove the setOnClickListener since you already specify in your view that the onclick function for the button is onClick . To avoid confusion rename your button android:onClick="onClick" , like android:onClick="imageButtonOnClick" .


I've got a linear layout that i have set true to be clikable + focus, But the problem is there is no focus displayed when clicked. How can i get the focus to be displayed.

Heres my code

<LinearLayout
  android:id="@+id/linear_tv_layout"
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_weight="1"
  android:clickable="true"
  android:focusable="true"
  android:paddingBottom="7px">