Questions tagged [android-appwidget]
Android App Widgets are custom views that can be placed on the home screen of an Android device.
991
questions
7
votes
0
answers
60
views
App WIdgets showing inconsistent behaviour
I have created an Appwidget in Android, and provided two buttons but I have found that during interacting with it sometimes, the UPDATE signal is being invoked and some times it doesn't.
Following is ...
4
votes
0
answers
43
views
Are AppWidgets possible on AndroidTV?
We know that in Android Phones we do have "App-Widgets" which remain in the home screen.
I have tried to run the same mobile app on an Android TV. App works fine but if I do a long tap on ...
0
votes
0
answers
24
views
Why does my Android Widget stop working randomly and on update
I created a command prompt widget for android, it's my first time working with Xamarin, and Android development, and it's been rough. Everything works as intended except the widget stops working after ...
0
votes
0
answers
85
views
Android Workmanager: "You have explicitly disabled WorkManagerInitializer in your manifest...."
I use workmanager in appwidget with a separate process,
<receiver
android:name=".todo.calendar.appwidget.ScheduleWidgetSmall"
android:exported="true&...
0
votes
0
answers
66
views
How to set image (any file size) of ImageView when creating (home screen) widget in Android (API +24) in Kotlin
I have a problem, I need to create a widget in Kotlin which has to get images from system gallery and display them in ImageView (random pick).
I successfully made it work in MainActivity (which mustn'...
1
vote
2
answers
206
views
Delete the Glance widget from home screen
I would like delete my widget (Glance Jetpack) from the home screen, but unsuccesfull. My code is:
val scope = CoroutineScope(Dispatchers.Default)
scope.launch {
val glanceId =...
2
votes
0
answers
127
views
Android AppWidget not updating and resetting on app launch
I'm trying to add an AppWidget to my Android app, built with Kotlin, Jetpack Compose, Room and Dagger-Hilt.
The general idea is for the widget to display the quote of the day, by picking it from the ...
0
votes
0
answers
77
views
How to get the value switch (On/Off) from a Widget , Android ,Java
I am developing a widget for turning on/off by a switch
The widget contains TextView and Switch :
You can look at the code below that i have done so far
The widget class extends from AppWidgetProvider
...
0
votes
0
answers
12
views
Hello, I want to display a real time in a variable and display a real date in a txttime
views.setImageViewBitmap(R.id.imgtime, BuildUpdate("20:25 ",200,context));
views.setImageViewBitmap(R.id.imgdate, BuildUpdate("26/02/2023",100,context));
0
votes
1
answer
51
views
Android - How to perform additional action on app widget click
I have an app widget which when clicked opens a fragment.
val pendingIntent = NavDeepLinkBuilder(context)
.setGraph(R.navigation.my_nav_graph)
.setDestination(R.id.my_fragment)
...
0
votes
0
answers
37
views
Android AppWidgetProvider OnUpdate and Application Upgrade scenario
I wanted to update the widgets information on the Application version update.
I know the onUpdate method of AppWidgetProvider gets called in App upgrade, however, the same method also gets called ...
0
votes
0
answers
36
views
How to implement a Toggle Button in App widget for the Android Version 11
How to implement a Toggle Button for the App widget in Android Version 11?
I tried to implement Toggle Button in App widget but it's crashing .
0
votes
0
answers
21
views
Showing Activity in Widget on minimise
Is there any possibility of showing activity in widget when app is in background?. As I'm creating a video call application,it is a must have feature.Please suggest me with some good approach.
...
1
vote
1
answer
145
views
How to launch widget Config when placing a widget using requestPinAppWidget()
Current Situation
My widget uses a config Activity to Select type of Widget..
So whenever I place my widget (using system launcher), the config activity launches first. It asks for configuring the ...
0
votes
0
answers
65
views
How to take user to select appWidget to pin into screen From my App
I have developed a Widget for my Android App, and It can be added in following ways.
User can long press in the Home launcher and select Widgets and then drag and drop to Home Launcher Screen, like ...
0
votes
0
answers
140
views
Android Service : java.lang.IllegalStateException: Calling View methods on another thread than the UI thread
I have been searching and trying many things from few days but nothing worked..
I have an appwidget. It has a Service and an Activity(launched when clicked on the button of widget).
This app widget ...
-1
votes
5
answers
361
views
FLUTTER showModalBottomSheet
how can i controll the default pop property of bottom sheet.Like I want to asign a value to a variable when showModalBottomSheet is popped .I have tried to do with controllers
0
votes
0
answers
41
views
Handle Clicks on Android AppWidget/RemoteViews
i'm trying to implement customizable widgets by drawing a Bitmap and applying it to an ImageView. Visualization works fine but I can't intercept the touches depending on the area clicked by the user. ...
0
votes
0
answers
55
views
Android 12 App Widget. Flag configuration_optional ignored
I created App Widget for Android 12 and use flags in xml file:
android:widgetFeatures="configuration_optional|reconfigurable"
But configuration_optional is ignored. If remove reconfigurable ...
0
votes
0
answers
30
views
If I check value once it store in array but if I uncheck it it doesnot remove
`Here problem is I have make an array where checked list items will be store and it works properly but when I uncheck it it doesn't remove from list and I am not figuring out why it is happening. ...
1
vote
2
answers
162
views
Open existing activity with back stack by tap on app widget. How?
I want to open my app by tap on a app widget. So.
remote_views.setOnClickPendingIntent( R.id.layout, PendingIntent.getActivity( context, 0, new Intent( context, Main.class ).setFlags( Intent....
0
votes
1
answer
19
views
Using resources from different packages
I have a style defined in style.xml in a package.
Can that style be used in a different package programmetically like
textView.setTextAppearance(R.style.style_from_different_package)
I am trying this ...
0
votes
0
answers
491
views
Android app widget not showing up in the List but works smoothly in Android 12 device
I have developed the widget following the official developer guide - Make a Simple App Widget, and It works as expected for Android 12 devices but fails in Android 11 - not in the listing, and QA team ...
0
votes
1
answer
76
views
Reduce ListView height when there are fewer items
I have ListView to be used in the app widget.
The list view has a fixed height of some 140 dp to accommodate 3 items, now when there is only one item to show, there is space left below the item.
I ...
3
votes
0
answers
403
views
How to customize the Home Screen Widget in Android Automotive App
How I can customize the Home Screen widget in Android Automotive OS.
I have tested apps on polestar and volvo, but I didn't find any solution to update or customize the home screen widget.
Widget ...
0
votes
2
answers
309
views
Refresh AppWidget with network request using RemoteView button
tl;dr question:
How to properly refresh widget e.g. every minute making network request in background, reliably working Android 5-13 and according to policy
I have an app widget which needs to be ...
2
votes
1
answer
282
views
How does Jetpack Glance widget works without XML? How does it convert to RemoteViews?
Jetpack released a tool called "Glance" that we can replace RemoteViews XML widgets.
I wonder how it converts compose layouts to RemoteViews.
4
votes
2
answers
826
views
Is it safe to use Coroutines runBlocking() inside onDataSetChanged of RemoteViewsFactory?
I am trying to fetch some latest movie images and display them in the Android app widgets, As per the requirement, the widget should refresh every hour to get the latest movies images.
Since I am ...
0
votes
1
answer
356
views
Glance widget does not pop up when holding on the app launcher
The glance widget does not pop up when holding on the app icon, though the receiver is registered.
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android=...
1
vote
0
answers
73
views
How to update appwidget automatically if calendar data has changed?
I want to update appwidget automatically if calendar provider data has changed, but listening to calendar changes through intent ACTION_PROVIDER_CHANGED works on not all the Android versions.
My ...
1
vote
0
answers
112
views
Listen to android calendar changes. Problem on Android 12
I use an intent filter to receive in the appwidget provider if calendar was changed and update the widget in case of changes...
My code in Manifest:
<receiver android:name="my.package.name....
1
vote
0
answers
40
views
Can we add image path (of local database) to the android APP widget (Home Screen Widget)?
Context: I am creating a flutter app wherein the screenshot of a particular app-page needs to be shown in app widget.
On Android side, we are using Kotlin (which I have no idea of, I don't even know ...
0
votes
1
answer
432
views
Android app widget's visibility is not updated
I reduced a bigger portion of code to this easy to test AppWidgetProvider class and I still have this problem.
Basically, I have a simple navigation part with a prev and next button. If the index is 0 ...
0
votes
1
answer
402
views
Cannot execute pendingIntent in App Widget (Android12)
My widget is working and directly going to the activity I put below. But when it comes to my Android 12, when I click my widget on the home screen it only runs the default starting activity that can ...
2
votes
0
answers
386
views
How to show image in android remote view using content URI?
I am having trouble trying to show an image in a remote view with a contentUri. I have outlined the steps I took below. I believe I have followed the procedure correctly but still get a "Can't ...
-1
votes
1
answer
521
views
Why is onReceive called multiple times?
I am running a worker in a glance composable on android.
why is onReceive being continuously called in an infinite loop?
What am I missing here?
class MyWidget : GlanceAppWidget() {
@Composable
...
1
vote
1
answer
486
views
How to achieve Google's Android 12 app widgets backgrounds?
Android 12 came with the new app widget feature "device theming" using the system's default theme @android:style/Theme.DeviceDefault.DayNight.
Seeing a screenshot like the one below in the ...
1
vote
2
answers
529
views
Force app widget's light theme on OnePlus phone with Android 12
I have a problem with forcing a light theme of home screen app widget on OnePlus 9 phone with Android 12 (using the OnePlus' launcher). My widget's theme inherits from Theme.MaterialComponents.Light ...
1
vote
0
answers
45
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
185
views
I have added button to Fragment, now i am trying to register that button to Javafile of fragment, but its giving me error in java file
public class SlideshowFragment extends Fragment {
private FragmentSlideshowBinding binding;
public Button btn1,btn2;
@Override
public View onCreateView( LayoutInflater inflater,
...
1
vote
1
answer
205
views
How to identify multiple instances of Glance App Widget
I am trying to create a widget which shows information about a hardware device.
There can be multiple of these devices and user will be able to add same widget for different devices.
I am looking for ...
3
votes
0
answers
420
views
onUpdate() callback not called for app widget after application update
I have developed a simple Android application containing a widget showing the current location, the full code is published on GitHub. I implemented the application according to the official ...
0
votes
1
answer
186
views
How do I constraint my widgets to the parent view and to one another to ensure they are aligned as a whole?
My widgets appear to be perfectly aligned in the DESIGN display of android studio, however when I run my app, its appearance differs on the emulator. Only the two pair of widgets (a pair consisting of ...
6
votes
1
answer
2k
views
E/GlanceAppWidget: Error in Glance App Widget IllegalStateException: CompositionLocal LocalConfiguration not present
I am developing an app widget with compose. I have a problem with getting string from resources. If I give text as a string like text = "Label", it is working properly. But if I give with ...
3
votes
2
answers
2k
views
error: resource android:dimen/system_app_widget_internal_padding not found
I am trying to create an application for Android on Android studio for widget.
Every time I try to run my app on emulator, I receive this error
AAPT: error: resource android:dimen/...
0
votes
1
answer
210
views
Update app widget every minute not working
I need to show a countdown timer in the app and I need to do it with widgets. Since the counter is an hour counter, it must be updated every minute. I get the time to countdown from SQL database. I ...
1
vote
1
answer
38
views
How to instantiate Presenter in AppWidgetProvider?
I am trying to use a presenter with AppWidgetProvider.
I have an instance variable as following
private latelinit var presenter: Presenter
Then inside onEnabled, I set the presenter. And then inside ...
0
votes
0
answers
63
views
appwidget update textview on 12am everyday
I have an app widget and I want to update the text view everyday on 12 am,I don't know what to do
here is my widget provider class:
public class WidgetProvider extends AppWidgetProvider {
@...
-2
votes
1
answer
262
views
AppWidgetTarget doesn't work inside RemoteViewsFactory. How to get around this?
There is not enough documentation or blogs around this topic.
Can someone point me in the right direction? Tried this in getView. Works on an imageview that is not part of item of listview.
...
0
votes
0
answers
130
views
How to force using night/day resources in a widget?
I need to show an app widget in the day, night or system theme. All colors are defined through resources.
How to ignore system theme and force using "day" or "-night" resources? I ...