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
2
votes
1 answer

Why am i getting kotlin.UninitializedPropertyAccessException even if lateinit property is initialized (probably)

Ok so I declared a lateinit var job in a widget as below. class TempHumidDisplayWidget : AppWidgetProvider(), CoroutineScope { private lateinit var job: Job override val coroutineContext: CoroutineContext get() = Dispatchers.Main +…
Animesh Sahu
  • 7,445
  • 2
  • 21
  • 49
2
votes
1 answer

make widget set to home screen after install/first launch?

I have code to make a shortcut of my application on the home screen when the user firsts opens the application. Is it possible to make it so that the application sets it so that when the user opens the application the shortcut is replaced with the…
Christian
  • 958
  • 5
  • 23
  • 52
2
votes
1 answer

I want to set Brightness of an image on SeekBar OnProgres change event in Android?

I want to set Brightness of an image on SeekBar OnProgres change event? I am showing an image in imageview and below that there is an SeekBar to change the Brightness of an image. 1) I am using following function to set brightness private static…
PCS
  • 211
  • 3
  • 11
2
votes
0 answers

Refresh existing data on widget

I am implementing news widget for android. In the onUpdate I am fetching all the data (about 50 articles which contains some text and urls). I wish to implement left and right buttons to cycle between the news items. But onReceive I can only call…
Dim
  • 4,527
  • 15
  • 80
  • 139
2
votes
1 answer

Android Studio 3.5.3 does not import some widget

Android Studio does not import some widget. I have tried the following options and all have failed. 1.Invalidate cache and Restart 2.Clean and Rebuild Project 3.Exit AS,delete .iml file and .deal folder,import the project 4.Sync with File…
Gabriel Rogath
  • 710
  • 2
  • 8
  • 23
2
votes
1 answer

state_pressed background for multiple views, onClick

How to achieve an android:background change effect on multiple Views at the same time, on clicking any of them? I got a "badge" layout in two parts. They act like one button, but the two parts have different StateListDrawable (selectors) defining…
JOG
  • 5,590
  • 7
  • 34
  • 54
2
votes
1 answer

TextClock is not working in the same format after changing Locale in Kotlin

I am using TextClock in hh:mm:ss a format to show current time. But when I change the locale from English to Spanish(es) TextClock gives time in wrong format i.e hh:mm. This is happening only in Samsung Tab.
Kartika Vij
  • 493
  • 2
  • 4
  • 18
2
votes
0 answers

Android: Looking for different TimePicker Style

Hello everyone a brief question - I have been hunting for this style of TimePicker to no avail so far(as shown on DroidDraw): I start doubting the existence of that style ... :P Anyone who's got a clue on how to get my hands on it - thanks in…
Ready4Android
  • 2,022
  • 2
  • 25
  • 29
2
votes
1 answer

Layout design problem

in android i m trying to make a simple form with two buttons.. but i am facing alignment issue. can you please help in that.. here is the code
Naruto
  • 9,476
  • 37
  • 118
  • 201
2
votes
2 answers

Android widget that requires data fetching only shows loading

I am trying to add a widget in view by an android widget picker. A simple analog clock widget is displayed correctly but widget, where data have to fetch, is only showing loading without showing data as in the screenshot below. My widget creation…
Xuzan
  • 335
  • 1
  • 11
2
votes
1 answer

Effect in Android during changing the Activity

I want to set the Animation during calling the Activity from one to another activity. I know its possible threw the Animation xml file. But I want to set the Animation as like that. . . While the activity is called, current screen goes current…
user644458
2
votes
2 answers

State list for PreferenceScreen?

I've added a widget layout to my preference screens showing an arrow icon, to indicate to users that there are more preferences behind a given PreferenceScreen. However, I notice when a PreferenceScreen is not enabled it is darkened. Is there a way…
Nathan Fig
  • 14,970
  • 9
  • 43
  • 57
2
votes
2 answers

How to trigger a broadcast event manually

Everyone This is a question about how to creating a widget in my application. We all know how to add our widgets by customizing AppWidgetProvider. And the adding action is as follows: System Menu -> Widget -> Widget Item(Our Widget Name) However,…
machinarium
  • 631
  • 6
  • 17
2
votes
2 answers

Wrong initial value of Chronometer

I writing a simple chess clock app based on android.widget.Chronometer. I'm using it with setCountDown(true) flag and all logic working well. Each Chronometer creating in a separate Fragment. But sometimes there are some problems with the…
Stanislav Batura
  • 420
  • 4
  • 11
2
votes
3 answers

How to update a widget if the related service gets killed?

I have an audio recording app, for which I am currently developing a widget. Recording is performed by an audio engine running in a service put in the foreground state. Whenever the audio engine state changes to pause/play/record, a broadcast is…
olivierg
  • 10,200
  • 4
  • 30
  • 33
1 2 3
99
100