Questions tagged [android-widget]
Either relates to Home Screen widgets, or to general UI elements used on an Android Application screen.
5,690
questions
0
votes
0
answers
30
views
Widget opening wrong Activity/MainActivity
I have a widget in my app, i added an intent to open a specific activity, but it still opening mainActivity. I checked passing intent from both onRecieve() and onUpdate(), still same.
although it ...
0
votes
1
answer
40
views
Can we handle voice command from assistant widget?
I'm able to integrate Android widgets with Google Assistant. And want to have some voice command experience.
For example the CREATE_CALL intent, if user is trying to call Alice by saying call Alice ...
0
votes
1
answer
23
views
Display AppBar on certain condition
Is it possible to Bring down or display the appbar only when the draggable sheet reaches the top of the page in flutter?
And having another doubt.
Is it possible to navigate from the home page to ...
1
vote
1
answer
12
views
Android: Widget doesn't save CountDown variable
I'm making an Android widget which launches a CountDown when I click on a button (signaled by the intent TAG_WAIT2_CLICK).
I'd like the button not to launch a new CountDown until the current CountDown ...
1
vote
1
answer
19
views
Android: displaying a preview of widget in my own app
I'm creating an App that has a homescreen widget, and I'd like to have it so the user can see a live preview of what the widget will look like, within my actual App activity, when they're configuring ...
0
votes
0
answers
22
views
onDataSetChanged() is not called after notifyAppWidgetViewDataChanged in case of Android 12
Why onDataSetChanged doesn't react on notifyAppWidgetViewDataChanged in app widget to update listview in case of Android 12? Does somebody know, what's changed in Android 12?
Similar problem on ...
0
votes
0
answers
40
views
How do I inflate a ViewStub in widget provider?
How do I do this with RemoteViews?
Let's say my XML looks like the following:
<LinearLayout
android:id="@+id/main_layout"
android:orientation="vertical"
...
0
votes
1
answer
42
views
How to read preference with glance Widget Jetpack compose?
I'm trying to do a weather app with a widget.
I call open weather map api and I can see the wether in the main screen on the phone.
I save them in dataStore with :
mainViewModel.setCity(city)
fun ...
-2
votes
1
answer
30
views
How can I create widget with timer?
I am working on one application with has a widget functionality So I have designed a widget but tried with timer.
widget is working on background after kill the app.so can you guide me to set current ...
0
votes
0
answers
21
views
How to host widgets in an Android launcher app (stuck on "Loading...")
Every example I've seen of this uses a picker and startActivityForResult() which is deprecated. I've attempted to host the analog clock, but it's stuck on "Loading widget..." What am I ...
0
votes
0
answers
15
views
requestPinAppWidget with arguments
I am using:
val bundle = Bundle()
bundle.putString("id", item.id)
appWidgetManager.requestPinAppWidget(provider, bundle, pendingIntent)
To pin widget.
I want to pass bundle with ...
1
vote
3
answers
44
views
How to use widget lists in ListView.builder?
class CardPage extends StatelessWidget {
String title;
String description;
CardPage({Key key,this.title,this.description}) : super(key: key);
@override
Widget build(BuildContext context) {
...
0
votes
2
answers
45
views
How to remove or hide the application button
I'm new to android studio and I'm trying to remove a button from my videos app
I have 4 buttons in my app Android : Recent,Featured,Popular,Random and Live.
I would like to delete the Live button, but ...
0
votes
3
answers
34
views
Flutter - ListView scroll not working (bottom overflows by some pexels)
Flutter - While importing listview widget from one file then it just throws an error on the app's screen "Bottom overflowed by 500 pixels" but when if listview is directly used inside the ...
1
vote
1
answer
52
views
Receiving "old" Intent data from Widget PendingIntent. How to clear out?
My WidgetConfigActivity creates an onClickListener PendingIntent to pass through RemoteViews to perform two tasks: (1) open SliderActivity and (2) pass the appropriate appWidgetId.
val views =...
0
votes
1
answer
132
views
Glance App Widget state not saved inside CoroutineWorker
I want to update my Glance App Widget state inside CoroutineWorker:
class MyWorker(appContext: Context, workerParams: WorkerParameters) :
CoroutineWorker(appContext, workerParams) {
override ...
0
votes
1
answer
64
views
Issue when implementing two AppWidgetProvider for two different Android Home Screen Widgets
My Objective:
Create two Android Home Screen widgets for an app of two different sizes (3x2 & 5x2) as discussed in this StackOverflow question: Multiple widget sizes. As mentioned, two classes ...
0
votes
0
answers
27
views
Android AppWidget - sometimes the onDataSetChanged() method doesn't get called
I noticed strange behavior of the widget in my app. Sometimes the onDataSetChanged() method from RemoteViewsFactory class is not called (of course when the app is in the background and widget is ...
1
vote
1
answer
253
views
How to make live update of glance widget?
Is that possible to make live update the data of Widget using Glance jetpack compose ? Like update data while database is changes . For example while I am using flow so flow should be able to update ...
0
votes
0
answers
32
views
Is there a way to launch a specific flutter route directly from Android homescreen Widget?
Sorry if there is anything wrong with the terminology I use. I would try to be as specific as possible and add extra info in brackets if i am not sure about the technical term.
I am creating an ...
0
votes
1
answer
36
views
Change drawable color for home-screen widget
I have a home-screen widget the background color of this widget needs to change. I tried this code:
remoteViews.setInt(R.id.background, "setBackgroundColor", MY_COLOR);
But the code change ...
0
votes
0
answers
49
views
Android Widget: onReceive not being called for Pending Intent Broadcast
Objective:
Attempting to play an audio file when the Widget Button is clicked.
Problem:
The button is getting added, but after pressing the button, the onReceive method doesn't get called.
Is there ...
0
votes
0
answers
46
views
Update appwidgets at exact time with repeating (AlarmManager with setExactAndAllowWhileIdle method)
I have a project with 2 types of appwidgets each of which has own AppWidgetProvider.
All widgets show current date, therefore have to be updated every midnight at exact time.
I've tested the situation ...
0
votes
0
answers
65
views
Shapes, Material You and Android Widgets
I'm revamping my app's widget to follow the latest Material You guidelines, and i found many great inspirations looking at the screenshots from Google, like this one for example:
The main question is,...
0
votes
0
answers
15
views
How to update appwidget after installation a new version of the application over previous version?
I have an appwidget application.
After install a new version of my app over the previous one the appwidget (which was on the Home Screen) stops showing all the information - calendar events + month ...
1
vote
1
answer
38
views
Rounded Corner Progressbar on App Widgets
I am creating a widget for my app. Currently I am just using a normal Horizontal ProgressBar. It works just fine. But I was finding a way to make the corners of the progress bar round. As the ...
1
vote
1
answer
49
views
onDataSetChanged() in RemoteViewService is not called after notifyAppWidgetViewDataChanged
In my AppWidgetProvider class I have the following code inside the onUpdate() method:
// Update each of the widgets with the remote adapter
for (int appWidgetId : appWidgetIds) {
...
0
votes
1
answer
91
views
Where should I call API in collection (configurable) android App widget
I have a configurable/reconfigurable collection Widget in this I have to call an API for a list so where can I call API (I need to change API when configuration change).
I am trying to call post-API ...
3
votes
2
answers
129
views
Retrieving intent extras from widget
I'm making a widget for my WebView app, and it's got a list of buttons on it. Currently, It's firing an intent whenever their pressed. In that intent, I'm putting some string extra's, but when the ...
0
votes
0
answers
20
views
AppWidgetProvider Listen for System Setting Changes
I have a widget that user can see the current status of an accessibility service and by clicking it, the accessibly service setting opens.
class MyAppWidgetProvider : AppWidgetProvider() {
...
0
votes
1
answer
42
views
BroadcastReceiver with acton SCREEN_ON in background
I want to listen when screen of device is on and update widget but BroadcastReceiver does not work when I close my app. It works only when application is running.
AndroidManifest.xml:
<receiver
...
1
vote
0
answers
79
views
Update widget by Broadcast message
I want to develop widget, which shows my public IP. For updating this widget I want use next broadcast messages:
android.net.conn.CONNECTIVITY_CHANGE
android.net.wifi.STATE_CHANGE
android.intent....
0
votes
0
answers
18
views
Does anyone have idea why the following calendar home widget is not workable in real device Android 12 (Work in emulator though)
I have received a few reports, that my calendar home widget is not workable in Android 12 device.
Like Samsung Galaxy S22 Ultra (SM-S908B/DS), Pixel 4a.
I have tested in Emulator with Android 12. It ...
0
votes
0
answers
44
views
Update widget when time changed
I have a widget in my application, I want it to be updated when the time changes. I tried to add actions into the receiver, but it does not work.
<receiver android:name=".Widget....
0
votes
1
answer
23
views
How to update multiple types appwidgets from the fragment of ConfigActivity by pressing one button?
I've made 2 different types of appwidgets showing some calendar data.
Each type has it's own layout, AppWidgetProvider class, AppWidgetProviderInfo object, but both of them use the same Configuration ...
0
votes
0
answers
89
views
Android widgets: Delay in getting the first ENABLED and UPDATE broadcast for widgets
I am working on a rooted device. I am trying make a simple widget and a launcher with a widget host. I am following this developer link as it is.
My widget has a single button which prints a random ...
0
votes
0
answers
39
views
Android home screen widget - how to add option to launch apps from the widget
I have a nicely working widget.
I have an idea to add an option for the users to launch any (previously installed) app from the widget by pressing the dedicated button. So I want users to be able to ...
0
votes
1
answer
153
views
How to pass custom model list to Jetpack Glance Widget?
I want to pass custom model list to glance widget but when i send to list and update widget then widget is re-creating.How can i pass custom model list to glance widget.My github project url in below....
-1
votes
1
answer
655
views
Android 12 BroadcastReceiver onReceive intent.getExtras allways null
I'm trying to build a stackview widget, which should display differnt data when swiping through it.
So far everything is working, but when I want to receive the index of the clicked card in the widget,...
2
votes
1
answer
41
views
How to update more than one Remote View in Android Studio Widget
That's my code for the widget
class MovieOfTheDayWidget : AppWidgetProvider() {
override fun onUpdate(
context: Context,
appWidgetManager: AppWidgetManager,
appWidgetIds: ...
0
votes
0
answers
26
views
GestureDetector in RemoteViews
I have a RemoteViews for my app on the homescreen. I would like to add a GestureDetector that detects when the user swipes right/left on the remoteView widget. Is it possible to implement such ...
0
votes
1
answer
82
views
How To Listen To Items Clicks in Widgets Xamarin Android?
The Problem
I've implemented this code AppWidgetListView and I've tried to attach clicks.
What's going well: so, clicks from buttons from widget but outside the ListView, works. You can see the click ...
0
votes
1
answer
79
views
can you navigate between widgets with only one scaffold
I have created a widget with a scaffold and called a widget in it as
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor:...
1
vote
1
answer
1k
views
What does WidgetsBinding.instance?.addObserver(this) does exactly?
Are we adding a listener to the instance of widgetbinding that would listen to lifecycle event in our app? how is WidgetBindingObserver class helping here exactly, could someone please explain me?
...
0
votes
0
answers
88
views
Expandable overlay widget
I would like to create a widget similar to the image below. It should be expandable on drag and should overlay other widgets when it is expanded. Any ideas on that?
0
votes
0
answers
33
views
images are not spread_inside horizontally on bigger devices when using androidx.constraintlayout.helper.widget.Flow
I am using androidx.constraintlayout.helper.widget.Flow for show images and to spread them horizontally, one smaller devices it works fine but on a bigger android device like onePlus, images are ...
0
votes
2
answers
344
views
Crash in glance app widget image when trying to display bitmap
When I try to display a bitmap image (of my app icon) in the app, it works ok, but crashes when I try to display it in Widget Glance.
This is my code for bitmap:
val icon = packageManager....
0
votes
0
answers
81
views
load an svg file url into remoteview imageview in android widget
I have a url for an svg file. which i want to display on an image view that is on a home screen widget, and
i tried converting the svg into a bitmap using coil and setting it using removeView....
4
votes
1
answer
924
views
Starting WorkManager task from AppWidgetProvider results in endless onUpdate calls
I am trying to create a widget and as stated in this guide,
…If your widget setup process can take several seconds (perhaps while performing web requests) and you require that your process continues, ...
0
votes
1
answer
51
views
Updating an analog clock appwidget
I am looking for a way to update a custom analogue clock every minute as a homescreen widget.
The built in AnalogClock widget was deprecated. The minimum interval for a JobScheduler is 15 minutes, and ...