All Questions

4865
votes
36answers
1000105 views
2825
votes
65answers
1119154 views

Close/hide the Android Soft Keyboard

I have an EditText and a Button in my layout. After writing in the edit field and clicking on the Button, I want to hide the virtual keyboard. I assume that this is a simple piece of code, but where ...
693
votes
36answers
541537 views

You need to use a Theme.AppCompat theme (or descendant) with this activity

Android Studio 0.4.5 Android documentation for creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.html If you want a custom dialog, you can instead display an Activit...
554
votes
11answers
277802 views

What does android:layout_weight mean?

I don't understand how to use this attribute. Can anyone tell me more about it?
130
votes
23answers
162967 views

ListView inside ScrollView is not scrolling on Android

I am having trouble with a scrolling ListView inside a ScrollView. I have an Activity which has some EditTexts in the top part and then a tab host with two tabs which have one ListView each. When the ...
1040
votes
18answers
436938 views

Difference between gravity and layout_gravity on Android

I know we can set the following values to the android:gravity and android:layout_gravity properties: center center_vertical center_horizontal, etc. But I am confused regarding both of these. Wha...
337
votes
9answers
222519 views

View's getWidth() and getHeight() returns 0

I am creating all of the elements in my android project dynamically. I am trying to get the width and height of a button so that I can rotate that button around. I am just trying to learn how to work ...
198
votes
27answers
214559 views

Android list view inside a scroll view

I have an android layout which has a scrollView with a number of elements with in it. At the bottom of the scrollView I have a listView which is then populated by an adapter. The problem that I am ex...
667
votes
18answers
423110 views

Standard Android Button with a different color

I'd like to change the color of a standard Android button slightly in order to better match a client's branding. The best way I've found to do this so far is to change the Button's drawable to the fo...
110
votes
12answers
100264 views

Focusable EditText inside ListView

I've spent about 6 hours on this so far, and been hitting nothing but roadblocks. The general premise is that there is some row in a ListView (whether it's generated by the adapter, or added as a hea...

Previous Next