Questions tagged [android-widget]

Either relates to Home Screen widgets, or to general UI elements used on an Android Application screen.

From Android Documentation

Widgets are an essential aspect of home screen customization. You can imagine them as "at-a-glance" views of an app's most important data and functionality that is accessible right from the user's home screen. Users can move widgets across their home screen panels, and, if supported, resize them to tailor the amount of information within a widget to their preference.

Common elements are :

  • AbsoluteLayout
  • AnalogClock
  • AutoCompleteTextView
  • Button
  • CalendarView
  • CheckBox
  • CheckedTextView
  • Chronometer
  • CompoundButton
  • DatePicker
  • DigitalClock
  • EditText
  • ExpandableListView
  • FrameLayout
  • Gallery
  • GridView
  • HorizontalScrollView
  • ImageButton
  • ImageSwitcher
  • ImageView
  • LinearLayout
  • ListView
  • MediaController
  • NumberPicker
  • ProgressBar
  • QuickContactBadge
  • RadioButton
  • RadioGroup
  • RatingBar
  • RelativeLayout
  • ScrollView
  • SearchView
  • SeekBar
  • SlidingDrawer
  • Spinner
  • StackView
  • TabHost
  • TableLayout
  • TableRow
  • TabWidget
  • TextSwitcher
  • TextView
  • TimePicker
  • Toast
  • ToggleButton
  • VideoView
  • ViewAnimator
  • ViewFlipper
  • ViewSwitcher
  • ZoomButton
  • ZoomControls
5711 questions
47
votes
4 answers

How can I do factory reset using adb in android?

How can I do the factory reset in android using ADB command? I had used adb reboot recovery command to get reset. But third party applications couldn't be cleared somehow.Is it correct way to achieve using ADB? Actually, I want to do factory reset…
Prashant
  • 1,351
  • 3
  • 20
  • 32
47
votes
1 answer

Widget onUpdate called when Configuration Activity is launched

I'm implementing a widget and I'm facing the following problems: 1) onUpdate is called when I add the widget to the home screen, even if I specified a Configuration Activity. As soon as I add it to the home screen, the APPWIDGET_ENABLED broadcast is…
46
votes
2 answers

Example of using Android tabs with Views instead of Activities?

The Android Developers TabWidget tutorial says the following: "You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity, or use the tabs to change between entirely separate activities." The tutorial…
David
  • 461
  • 1
  • 4
  • 3
46
votes
6 answers

ListView with clickable/editable widget

Is it possible to use a OnItemClickListener on a ListView when the Items layout has a clickable/editable widget (RadioButton,EditText, or CheckBox)?
bugzy
  • 7,086
  • 9
  • 42
  • 44
45
votes
5 answers

How to access resource with dynamic name in my case?

If I get the image name as a variable like following: var imageName = SERVICE.getImg(); Then, how can I get the resource with R.drawable.????, I tried R.drawable[imageName], but it failed. Any suggestions?
Leem
  • 17,220
  • 36
  • 109
  • 159
45
votes
8 answers

Android Custom Shape Button

How can i make a custom shaped clickable view or button in Android? When I click , I want to avoid touching on an empty area . please help. Thank you.
44
votes
7 answers

Android getMeasuredHeight returns wrong values !

I'm trying to determine the real dimension in pixels of some UI elements ! Those elements are inflated from a .xml file and are initialized with dip width and height so that the GUI will eventually support multiple screen size and dpi (as…
oberthelot
  • 1,310
  • 1
  • 11
  • 23
44
votes
7 answers

Android: Hide child dividers in ExpandableListView

I need to completely remove dividers from ExpandableListView. As for parent items it's a setDividerHeight method where I can pass a zero value. But there's no similar method for child divider. Is there any way to hide it?
Alexander Oleynikov
  • 19,190
  • 11
  • 37
  • 51
43
votes
4 answers

How to change default images of CheckBox

I am using ListView and for every row I have row_item.xml and I inflate that in code
Damir
  • 54,277
  • 94
  • 246
  • 365
43
votes
1 answer

Flutter: Is it somehow possible to create App Widgets (Android) and Today Extensions (iOS)?

I took a look at flutter for building a mobile app. Is it possible to create Widgets (not flutter-widgets, but App Widgets (Android) and Today Extensions (iOS)) in a flutter app? I guess it can't be done with dart, but is there a way of implementing…
hendra
  • 2,531
  • 5
  • 22
  • 34
43
votes
1 answer

When is it necessary to use singleTop launchMode in an android widget or application?

I just got burned by a widget. I could see the cause of the problem, but I could not determine why or its solution. My widget was issuing a search (SearchManager) and the activity launched a search dialog, but when it called-back to my widget, it…
mobibob
  • 8,670
  • 20
  • 82
  • 131
42
votes
9 answers

Changing size of seekbar thumb

I'm using a drawable for seekbar thumb with android:thumb="@drawable/thumb" How can I set the size of this thumb in dip unit? Because I use a style for seekbar like