Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

1 vote
1 answer
1k views

Changing the Visibility of Elements in a RecyclerView Row OnClick

I have the following app I'm working on, where I am trying to make it so whenever an image in the RecyclerView is clicked, its two corresponding buttons from the row xml will become visible (they are ...
Michael Dadi's user avatar
0 votes
2 answers
2k views

Android - Hide button during an onClick action

I need to hide a button during an onClick action like this: public void onClick(View view) { switch (view.getId()){ case R.id.button1: Button button2 = (Button) ...
Villat's user avatar
  • 1,465
-6 votes
5 answers
159 views

how to validate view visibility on button click listener

I am using this code for validation and only invisibility view is working . mute.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mute = (...
Mohammad Arman's user avatar
1 vote
1 answer
823 views

Android View doesn't become VISIBLE

I'm trying to implement controls for my music player. Here is my XML: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-...
Roman Svyatnenko's user avatar
0 votes
1 answer
931 views

Android change Button visibility after do onClick

If I call method in onClick() one time it works, but if I call it twice time in the onClick() method it doesn't work. private void changeVisible() { if(progressBar.getVisibility() == View....
SBrx's user avatar
  • 1
8 votes
2 answers
743 views

ListView expand animation for items only works after second click

I have a CardView with the following views: - RelativeLayout (view_1) - TextView - TextView - RelativeLayout (view_2) - ImageView - ImageView When i open my ListView view_2 is set ...
Mulgard's user avatar
  • 10.4k
0 votes
1 answer
2k views

onClick setVisibility visible and GONE doesn't work

I have made a small program in which i have used one button and a WebView. WebView visibility is set GONE and when i press the button 1st time i want to set visibility to visible and when i press the ...
user3511147's user avatar
0 votes
2 answers
1k views

Changing ProgressBar visibility from inside onClick

My activity_main.xml contains this progressBar, which starts hidden ("gone") <ProgressBar android:id="@+id/progressBar_sendingPhoneNumber" style="?android:attr/progressBarStyleLarge" ...
sports's user avatar
  • 8,109
0 votes
1 answer
486 views

onClick: jump/scroll to View/TextView

i created a button, which changes the visibility of a textview. Both are in a ScrollLayout and a vertical LinearLayout: ScrollLayout LinearLayout ...some other views... Button TextView /...
user2075243's user avatar
2 votes
3 answers
3k views

Changing the visibility of a textview in a listview

I have a listview which is build up of two textviews coming from a separate layout file. I use a BaseAdapter to build the list from a JSON file. I would like the first textview (Caption) to be ...
Tino's user avatar
  • 23
1 vote
2 answers
2k views

Problem with Image Button visibility! Android

I have an Image button. I made it invisible. But the onClick event is not getting triggered which makes the button visible. The button should initially be visible for 5seconds, become invisible and ...
adam's user avatar
  • 51
1 vote
1 answer
3k views

Android - Can't Click on Button

I have a button that is declared "gone" in the XML file: android:visibility="gone" Therefore, by default the button is hidden. The button will become visible depending on another condition in the ....
Raddfood's user avatar
  • 169
84 votes
9 answers
26k views

android View with View.GONE still receives onTouch and onClick

This is confusing me: As far as I have read, a view with setVisibility(View.GONE); should not receive any more touch- or click events. My layout has two parts, which will be visible or gone so that ...
ShadowMare's user avatar
  • 2,097
15 votes
4 answers
96k views

how to use visible and invisible for a button in android

I want to make a button invisible, when i click another button then the invisible button will become visible and then perform onClick() actions on the visible button. What onClick() actions I can use ...
Ramakrishna's user avatar
  • 4,086