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

How do we create select (combo) box in android

I want integrate one combo filled with currency types. please tell me any way to create select box in android. i have created spinner but i have similar different views to show on page. and it is not looking attractive. please share any code for…
Neetesh
  • 116
  • 2
  • 3
  • 7
2
votes
1 answer

Can a static arraylist of data objects cause memory leaks while the homescreen widget is running

In the following code i have a Class that contains a bunch of variables. I create a couple of instances of that class and save them to an arraylist. The arraylist is part of the same class, but marked static. The same app has a homescreen app…
einUsername
  • 1,569
  • 2
  • 15
  • 26
2
votes
2 answers

How to Set Layout with Mapview

I have created the Application in which i m Using MapView. Now i want to Use the Back Button in My that MapView. I have develop the Layout but it cant seen the Button over mapview. When i push back button from Emulator then the Mapview become close…
user644458
2
votes
2 answers

How to hide widget text on android?

I use the following code to update the text: RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); views.setTextViewText(R.id.widget_counter, Long.toString(unreadRecordsCount)); but how can I hide it, if unreadRecordsCount…
LA_
  • 19,823
  • 58
  • 172
  • 308
2
votes
1 answer

What does "index" stands for in TableRow.addView (View child, int index)?

Is it meaning that you can build a table row with an empty column ? I want to do a TableLayout like this : +--------------+---------------------+ + *Nothing* + LinearLayout + +------------------------------------+ + LinearLayout + …
Codii
  • 873
  • 7
  • 18
2
votes
0 answers

android DatePickerDialog year 2037

If i use DatePicker i can set the min and max year.
tütü
  • 1,481
  • 1
  • 10
  • 6
2
votes
1 answer

Android CustomHow to get Child Views from Custom ListView enclosed within linearlayout without clicking listview

I have a custom listview with two buttons and two textViews enclosed within linearlayout. I want to iterate through the listView without clicking the listView rows. When i do listView.getChildAt(position); position can be any integer from 0…
2
votes
2 answers

where to start for Page flip effect in android?

I have search a lot for page flip effect in android. I found some links. An example for flip without using OpenGL. But I want to implement a 3D real page flip effect for android. same as This Or the effect you have seen in IReader for…
Arslan Anwar
  • 18,746
  • 19
  • 76
  • 105
2
votes
1 answer

Embed custom view in android home screen widget

I am building a home screen widget and I want to add an advertisement to it. Currently the advertises SDK provides a custom view widget which I tried to embed in my home screen widget. But when I add it, it says problem loading widget. I'm guessing…
Hades
  • 3,916
  • 3
  • 34
  • 74
2
votes
1 answer

How to add space between buttons in same row

I found this example public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TableLayout layout = new TableLayout (this); layout.setLayoutParams( new TableLayout.LayoutParams(20,20) ); …
Damir
  • 54,277
  • 94
  • 246
  • 365
2
votes
1 answer

How to make view react on click

I have created custom widget which inherits View.
Damir
  • 54,277
  • 94
  • 246
  • 365
2
votes
1 answer

Android Widget Boilerplate?

I'd like to make a prototype of an android widget. Has anyone released a boilerplate that set's up most of the 'widgetness'? And would help me build a simple widget quickly?
Jordan Warbelow-Feldstein
  • 10,510
  • 12
  • 48
  • 79
2
votes
1 answer

Why is setOnClickPendingIntent not working?

I am attaching a pending intent to a widget button via .setOnClickPendingIntent and getting no response from it when the button is clicked. Oddly enough, when I implement this same code in my download service, it wants to work (but won't because the…
2
votes
1 answer

Custom Quick Action on click on widget

I have a problem. The constructor of QuickAction qa = new QuickAction(v); require View v, but how I can recieve parent view in AppWidgetProvider? this I use for register click PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context,…
Alex
  • 21
  • 2
2
votes
1 answer

Custom style for all ImageView widgets

The following code shows how you could prepare a custom style for all TextView widgets.