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

All Questions

Tagged with
560 votes
45 answers
312k views

How to check visibility of software keyboard in Android?

I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?
fhucho's user avatar
  • 34.4k
119 votes
8 answers
115k views

Animate visibility modes, GONE and VISIBLE

So im trying to animate when i set the visibility of a linearlayout with other widgets, from GONE to VISIBLE and the opposite.Im using togglebuttons to show and hide. Here's an image to show what i ...
Maxrunner's user avatar
  • 1,965
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
68 votes
6 answers
29k views

Why doesn't setVisibility work after a view is animated?

Why doesn't the textView become invisible? Here is my layout xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:...
ZippyFerguson's user avatar
65 votes
5 answers
198k views

How to change visibility of layout programmatically

There is a way to change the visibility of View in the XML, but how can I change programmatically visibility of the layout defined in XML? How to get the layout object? <LinearLayout android:id=...
Dariusz Bacinski's user avatar
34 votes
3 answers
27k views

toggle visibility of chain group in constraint layout

In previous xml layout, I have multiple view groups with few elements inside. Hide each view group will also hide all of its child elements. Since I wanted to have flat structure and tried ...
Tixeon's user avatar
  • 930
30 votes
13 answers
51k views

android setVisibility does not display if initially set to invisble

I have a glsurface occupying the full screen. At the click of a button I want another layout to appear (settings type of thing). If I start with the overlay being visible, I can make it invisible and ...
user1248322's user avatar
29 votes
5 answers
50k views

Animate visibility of a view from gone to visible with animation

I have a view that is invisible by default(Just for the first time). Now I need to switch the visibility to VISIBLE with this animation: if (myView.getVisibility() == View.INVISIBLE) { myView....
DastakWall's user avatar
28 votes
5 answers
30k views

Programmatically set google map fragment visibility (API2)

xml: <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapFragment" android:layout_width="match_parent" android:layout_height="match_parent" class="com....
David's user avatar
  • 37.5k
27 votes
5 answers
8k views

Objects visibility

I've done a lot of search but can't find the difference between tools:visibility = "visible" and android:visibility = "visible" ? Which situation I must use tools or android?
Gunay Abdullayeva's user avatar
25 votes
9 answers
26k views

What's the best way to check if the view is visible on the window?

What's the best way to check if the view is visible on the window? I have a CustomView which is part of my SDK and anybody can add CustomView to their layouts. My CustomView is taking some actions ...
bhups's user avatar
  • 14.7k
23 votes
5 answers
23k views

Hide radio button icon but not text

I need to hide a radio button's icon: something like setting it to invisible, but only the icon, not the text (setInvisible hides also the text). The icon should still take up space, so that the text ...
Luis Mendo's user avatar
  • 112k
22 votes
8 answers
34k views

Android: How to hide a ListView Item

How can you hide an item in a ListView or at least set its height to zero? I have tried setting the visibility of the View to GONE but it still maintains the item's space (height).
Tawani's user avatar
  • 11.2k
22 votes
2 answers
32k views

Determine if a view is on screen - Android

I'm a little bit stuck with this one - first and foremost, the following link has been useful however I've come up with a bit of an issue with visibility: The link: Check view visibility I have a ...
Hamz4h_'s user avatar
  • 963
17 votes
1 answer
3k views

ViewStub vs. View.GONE

As far as I undestand, neither a ViewStub nor a View that's GONE participate in the measure and layout passes (or rendering anyway). Is there a difference in rendering performance? What's the best ...
mxk's user avatar
  • 43.4k

15 30 50 per page
1
2 3 4 5
42