Questions tagged [remoteview]

A class specific to Android that describes a view hierarchy that can be displayed in another process. The hierarchy is inflated from a layout resource file, and this class provides some basic operations for modifying the content of the inflated hierarchy.

A RemoteView is a class specific to Android that describes a view hierarchy that can be displayed in another process. The hierarchy is inflated from a layout resource file, and this class provides some basic operations for modifying the content of the inflated hierarchy.

This is specific to Android, this tag should be typed as per the Android Tag Info.

331 questions
9
votes
3 answers

How to reference a view in a customized notification

In the below posted code i am create a notification with a customized layout. the layout of the notification contains three action buttons. the problem i have now is, i can not reference any of the buttons in the code so that I can navigate to…
9
votes
1 answer

How to create a notification with a custom view , but with an native look & feel?

Background I need to make a custom, big-style notification that has about 3 images on the bottom, and a title of and image and 2 textviews on the top. Something like that: The upper area needs to look exactly like the native notification, to make…
8
votes
1 answer

Android Widgets: How to add Views to RemoteViews on runtime

I want to add text views arranged in a linear layout to my widget on runtime. I do following: LinearLayout l = new LinearLayout(context); for (int i = 0; i < 10; i++) { TextView t = new TextView(context); t.setText("Hello"); …
kkgery
  • 431
  • 6
  • 13
8
votes
4 answers

Couldn't expand RemoteViews for: StatusBarNotification

This question has been asked before but none of the answers helped me hence posting my case. I am trying to build a custom notification using a layout file. But I get the following error: android.app.RemoteServiceException: Bad notification posted…
Vaibhav
  • 309
  • 2
  • 5
  • 16
8
votes
3 answers

Image in Widget

I am trying to set image in image view in widget layout in onUpdate, but image is not updating @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.i(TAG, "onUpdate…
8
votes
3 answers

Crash setTextViewTextSize in a widget only without Jelly Bean

I am making a widget in which you can specify the text size controles.setTextViewTextSize(R.id.LblMsg, TypedValue.COMPLEX_UNIT_SP, textSize); I am working with android 4.1 android:minSdkVersion="8" android:targetSdkVersion="16" The problem is…
Sergio76
  • 3,835
  • 16
  • 61
  • 88
7
votes
1 answer

Android Custom Notification with big animated gif image

I want to make a Custom Notification with big animated gif image. So I cannot find a solution resolve this problem. Because i can only use RemoteView to custome layout. Creating custom android notification without RemoteView But RemoteView just…
Hati
  • 111
  • 6
7
votes
2 answers

How to create Listview with help of remoteview?

I am trying to make dynamic listview in widget with help of remoteview, as I wanted this listview of application icons in a widget. I want to show incoming notifications from all apps which are separated application wise. I want to create standing…
kiturk3
  • 549
  • 10
  • 30
7
votes
1 answer

StackedWidget views not showing

When my StackedWidget view was only a textview, it displayed on the launcher screen, but with a more intricate layout (A RelativeLayout, imageview, textviews) it does not display anything Is there something I need to know about setting RemoteViews ?…
CQM
  • 42,592
  • 75
  • 224
  • 366
6
votes
4 answers

Retrieve text from a RemoteViews Object

I need to retrieve some text from a RemoteViews object. It is possible for me to get the LayoutId, but I have no idea how to retrieve text from a TextView that is in this RemoteView (namely a notification). Also the RemoteView only contains setters,…
Force
  • 6,312
  • 7
  • 54
  • 85
6
votes
3 answers

Layout weight on dynamically added RemoteViews

Within my widget, i'm using the following to dynamically add items (R.layout.widget_item) to a LinearLayout defined within my main widget layout: //-- Main widget layout RemoteViews views = new RemoteViews(context.getPackageName(),…
92Jacko
  • 523
  • 2
  • 10
  • 18
6
votes
0 answers

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.drawable.ic_notification_icon) …
Shashank Degloorkar
  • 3,151
  • 4
  • 32
  • 50
6
votes
3 answers

android.app.RemoteServiceException: Bad notification posted from package. Couldn't expand RemoteViews for: StatusBarNotification

I have implemented custom notification with RemoteViews widget. I tested it on Android 5.0.2 and Android 6.0. It was working fine. But after sometime, it started crashing everytime it received notification from GCM. Crash Dump - Process:…
6
votes
2 answers

How do I set a color filter on a drawable which will be used in a RemoteView?

I have an ImaveView on a RemoteView for which I have to apply a filter. When not in the RemoteView this is what I do and it works well: Drawable icon = getResources().getDrawable(R.drawable.icon); icon.setColorFilter(color,…
6
votes
1 answer

Is it safe to rely on the call to onDataSetChanged() after onCreated() in RemoteViewsFactory of an AppWidget

I developed my AppWidget according to the android doc, loading my cursor in onCreate() and reloading it in onDataSetChanged(), and everything worked fine, until I set some breakpoints in my RemoteViewsService.RemoteViewsFactory and surprisingly…
Hai Zhang
  • 5,574
  • 1
  • 44
  • 51
1
2
3
22 23