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
4 answers

How to get the AppWidgetId of a Compose Glance widget?

I have a table with all the widgets a user has created. I want to customize individual widgets using the according table entry and update the according table entry upon interaction with a widget. uid AppWidgetId Title 0 23 First…
2
votes
1 answer

Remove image from gallery on LongClick event

I'm new in android, here i'm using Gallery to show images in my application, working fine but the problem is now I want show some option like remove images from gallery on the LongClick event of the user.
dIvYaNsH sInGh
  • 1,943
  • 3
  • 21
  • 40
2
votes
2 answers

How to control background of a Edit text when in edit mode. For Android?

I have a edit text field. I want it to have a transparent background. But when the user tries to edit it, it should be with a different background say white color and text color as black. And when he is done with the edit of the edit text and moves…
Vinod
  • 31,933
  • 35
  • 96
  • 119
2
votes
3 answers

RecyclerView.ViewHolder's setIsRecyclable() func

I want to set my view holder to not recycle, here's the code: @Override public void onBindViewHolder(final ViewHolder viewHolder, final int position) { viewHolder.setIsRecyclable(false); } However, when I see the documentation here:…
2
votes
2 answers

Can i enhance touch sensitivity of a button?

I am working on an app, here i have two button, which navigate through the stories in my app, say next and previous buttons. They are not tapped properly, i mean i have to tap them twice or thrice to make them work on device. Is there anyway that i…
Usama Sarwar
  • 8,922
  • 7
  • 54
  • 80
2
votes
1 answer

Saving e-mail address to SIM card memory in Android

Does anyone know whether a SIM card can accomodate an e-mail field in its memory? I want to do it through an android application. Users can save contact name and number to a SIM card, but how about an e-mail field also along with name and number;…
Anees
  • 21
  • 3
2
votes
1 answer

Android EditText soft keyboard question

I have EditText what should get user input for airplane seat number (like 17G, 5A etc) Problem is then I set EditText input type to text, it always open up soft keyboard with text. But my input always starts with numbers, so user have to switch…
2
votes
0 answers

Android remote view display images from the web?

Does any know of a tutorial or something similar to help create a Remote View wigdet like this... I followed through the development guide on doing StackView widget. I did it but i dont know how to display images in the Stack like the example news…
coder_For_Life22
  • 26,645
  • 20
  • 86
  • 118
2
votes
1 answer

How to disable the blinking color/animations on other stars when one is clicked?

When I click on a star, the other stars are blinking before it gets full blue, I want to disable the dancing effect/animation/background color or whatever of the other stars when the respective stars are clicked. If anyone helps me to find a way to…
2
votes
3 answers

Launch another app from android 11 widget?

I can't launch widgets on android 11. This code works on my android 9 phone, but android 11 Google Pixel 3a emulator not working. what should I do for this. Ok, so what I want to do is create a widget that will simply launch another application…
2
votes
1 answer

Wordwrap problem in android

I am having a textview with multi line text. In some places textview is having webpage address like google.com yahoo.com etc.., Now because of multi line, wordwrap functionality is splitting google. in one line and com in other line, same is…
Ron
  • 359
  • 6
  • 21
2
votes
1 answer

How to get Display object from my service class?

Because many of my Activities need to check the screen size with the following code: Display display = getWindowManager().getDefaultDisplay(); int screenWidth = display.getWidth(); int screenHeight = display.getHeight(); I decide to move this code…
Mellon
  • 37,586
  • 78
  • 186
  • 264
2
votes
0 answers

Why does getAppWidgetInfo return null sometimes?

When updating my app widget I need to check the provider class name. appWidgetManager.getAppWidgetInfo(widgetId).provider.className But sometimes I face the exception Fatal Exception: java.lang.NullPointerException: Attempt to read from field…
2
votes
2 answers

How can I set the tab height in a layout XML file?

I used to use : tabHost.getTabWidget().getChildAt(0).getLayoutParams().height =50; to set my tab height. But I would like to move this tab height setting from Java code to layout xml files with the purpose to use different height value for…
Mellon
  • 37,586
  • 78
  • 186
  • 264
2
votes
2 answers

How to show different Activities in Fragment implementation?

It is my first time using android fragment. I am following this tutorial to implement a fragment. Everything is fine with this tutorial, I successfully get the result like below: In the tutorial, the DetailsFragment simply shows a TextView…
Mellon
  • 37,586
  • 78
  • 186
  • 264