329 questions
0
votes
1
answer
37
views
Getting an unwanted margin/border in all custom notifications only in android 14
Following code works in api<34 and the entire notification area is occupied by the remoteview layout. But an unwanted margin/border in the notification is seen when same code is executed on android ...
4
votes
1
answer
203
views
Unexplained BadForegroundServiceNotificationException in Crashlytics logs with varying layout references
I'm encountering a crash in production that I cannot reproduce locally. The crash is logged in Crashlytics as follows:
Fatal Exception: android.app.RemoteServiceException$...
0
votes
2
answers
101
views
How to make my widgets individual from each other?
I have created a command prompt widget for Android using Xamarin, and I'm trying to figure out how to set up my ListViewFactory class and RemoteViewsService class to have individual data per widget.
...
1
vote
0
answers
24
views
Android exchange notification for custom notification with swipe gesture on each view
I am suffering problem with too much notifications for my app and I am trying to divide single Notification to RemoteViews with multiple Views and serve swipe gesture on each of them (to dismiss ...
0
votes
1
answer
269
views
Unable to use TextClock in GlanceAppWidget as remote View
Based on the official documentation,
I can see TextClock seems to be supported now in new GlanceAPI as a Remote view, but I can not used in our example code,
class RemoteWidget : GlanceAppWidget(...
0
votes
0
answers
60
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. ...
1
vote
1
answer
460
views
Where can I find examples of testing interactions with android homescreen widgets?
I see very little information on how to test RemoteViews. For example, I have used UiAutomator to place an app widget on the homescreen and now i want to test if it updates correctly when I click on ...
0
votes
1
answer
382
views
How to setTextSize (TextView) in dp using RemoteViews
RemoteViews allow me to setTextSize TextView like this:
views.setFloat(R.id.appwidget_text, "setTextSize", fontSize);
but only with one argument. It will set font size in sp. I dont want ...
0
votes
1
answer
535
views
Remove programmatically generated layout in Widget usin RemoteView
I am creating a widget for Android but I'm facing an issue.
I have a container in my main widget layout, and I want to add it new line in the list dynamically.
For that, I use the addView methods on ...
1
vote
1
answer
589
views
Android updateAppWidget is called but not updating the widget or reaching RemoteViewsFactory?
My app widget (ListView showing game scores) works fine when created on the home screen, but when I call appWidgetManager.updateAppWidget(id, R.id.appwidget) inside the provider, there is no reaction ...
3
votes
1
answer
592
views
setBackgroundResource with RemoteViews not applying to layout
I'm trying to set the background resource of my layout in my app widget. I'm using setBackground resource with RemoteViews like so:
val views = RemoteViews(context.packageName, R.layout....
0
votes
1
answer
660
views
Android RemoteView set StateListDrawable programmatically
I have a Widget for my Android App. On this Widget there is a button. The user can freely choose the color of the button. So I also have to set the colors for the different button states dynamically.
...
1
vote
0
answers
55
views
setting mediaSession with a remote view
I have the following setup for a media style notification:
NotificationCompat.Builder nc = new NotificationCompat.Builder(this, CHANNEL_ID);
NotificationManager nm = (NotificationManager) this....
0
votes
1
answer
189
views
Radio button inside Remote view
I have a radio button inside the remote view of android. Upon clicking the layout of the radio button, it is getting selected but no animation or ripple effect is being shown. How to show the default ...
-1
votes
1
answer
713
views
Replace RemoteViewsFactory on receiving a broadcast in widget provider
I have an app with a widget showing a listview. I want to update the list based on the recipe that user opens in the app.
To do that first I send a broadcast with an extra integer when activity is ...
0
votes
0
answers
83
views
Custom notification is not creating when I add custom layout
I have to create a custom notification like what's app calling notification. Notification does not create if I add my custom layout to the NotificationCompat Builder. Below is my code to create ...
0
votes
2
answers
1k
views
Android: How can I change the color of a Drawable resource per element?
Edit 4/5: My getViewAt function is now this, and still no effect occurs
override fun getViewAt(position: Int): RemoteViews {
val v = (context.getSystemService(Context....
5
votes
3
answers
4k
views
Show GIF with glide in android notification
I have been trying to show a .gif image inside my custom notification using Glide library. I am only able to show static image on the notification panel.
RemoteViews collapsedView = new ...
1
vote
2
answers
915
views
Changing a background image of a remoteView button?
Cant quite figure this one out. I have a button on my Activity that once pressed opens a notification. This custom notification has a button on it. I'm trying to change the notifications background ...
0
votes
0
answers
78
views
Keeping Aspect Ration of ImageButton in AppWidget on Resizing
I've got an ImageButton in my homescreen widget.
It is supposed to get larger/smaller when the user resizes the widget but stay perfectly round.
The following code seems works to work on the emulator ...
6
votes
0
answers
1k
views
Custom notification layout gives unnecessary margin
I am creating a custom notification layout for my application.
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R....
1
vote
2
answers
1k
views
How to set custom layout for those notifications which will be shown when app is in background?
I implemented the firebase cloud messaging (FCM) service in my app and I get notifications with my custom layout but just when the app is in the foreground and the reason is clear, It is because of ...
0
votes
0
answers
575
views
Android remote view pending Intent not working
I have a service that I need to stop using a pending intent from the remoteview that is showing a custom notification. I have set the pending intent and registered the broadcast receiver in the ...
1
vote
1
answer
1k
views
How to add extra preview when adding widget on screen using requestPinAppWidget?
I saw in documentation:
EXTRA_APPWIDGET_PREVIEW
An extra that can be passed to
requestPinAppWidget(android.content.ComponentName, android.os.Bundle,
android.app.PendingIntent).
So I tried ...
-1
votes
1
answer
127
views
How to use SimpleDateFormat in Widget RemoteViewsFactory class?
I need to format date and time in the RemoteViewsFactory class. I know how to use DateFormat/SimpleDate Format. I'm doing it like in the thread below but the app keeps stopping when pressing on the ...