android-appwidget

Saving run-time generated NinePatch on external memory

我的梦境 提交于 2019-12-12 01:53:40
问题 I'm following this post to create nine patch drawable at run-time. I need to save the 9patch image on the internal/external memory, so that i can easily retrieve it's URI and assign it to an ImageView for example. Does anybody know how can I achieve this? P.S. Bitmap.compress method won't work, because it will save the image as a regular (not 9patch) png file. P.S. I know that I can serialize generated NinePatch object and save it to a file. But this way I can't assign it to a RemoteViews

App Widget getting hijacked by Google Sound Search?

六眼飞鱼酱① 提交于 2019-12-12 00:54:47
问题 So I'm seeing some bizarre behavior in an appwidget that I wrote. The widget itself is quite simple - it reads a few values from persistent storage and then displays them as text. Nothing fancy in the layout - just a FrameLayout root element with some Linear Layout and TextView children. The widget has a simple configuration activity associated with it. The bizarre behavior is that the widget will initially show "Problem Loading Widget" after the user closes the configuration activity, and

How to handle orientation changes for home screen app widget?

﹥>﹥吖頭↗ 提交于 2019-12-11 23:32:09
问题 Can anyone help me on how to handle orientation change for app widget? On orientation change my widget is showing layout with empty view and removing all listeners. 回答1: After research and studying some of the folks answers , I came to know the mistake i have done. After initial setup of the widget , I am again initializing remote views and trying to change only few views like when user taps on refresh button , iam making that view visibility gone and making circular progress loading view

Multiple, configurable widgets - update issue

江枫思渺然 提交于 2019-12-11 23:24:43
问题 When I'm adding single widget I can configure it properly and it's updated as supposed to after initial configuration. But when I add second and next instances of widget with the same or different configuration onUpdate is not triggered. Well, to be specific onUpdate is executed just before Configuration is set, when Configuration Activity is on top, so it works like: 1 widget - OK 2 widgets - First OK, Second not updated 3 widgets - First OK, Second OK, Third not updated and so on. Behavior

Illegal state on click imageview with background (selector)

送分小仙女□ 提交于 2019-12-11 20:22:39
问题 I have appwidget with collection ( listview ). Source widget xml layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/widget_list_background" android:orientation="vertical" android:paddingBottom="3dip" android:paddingLeft="6dip" android:paddingRight="6dip" android:paddingTop="3dip" > <!-- Header --> <LinearLayout android:layout

progress bar in appwidget for a playback service

五迷三道 提交于 2019-12-11 15:59:50
问题 I wanted to display a progress bar in an appwidget that displays playback progress from a background service. I know the appwidget supports that control, but I am wondering how I might go about updating the progress bar in a way that is consistent with good widget design (e.g. low battery consumption). The way I would normally do it in an activity would be by polling the playback on a timer. I haven't implemented this yet, so I am not even sure if it would work in an appwidget. Anyone know

Set App Widget to Home Screen programmatically

吃可爱长大的小学妹 提交于 2019-12-11 08:25:15
问题 I want to set my custom app widget to home screen. I have searched a lot and implement code and also run some demo But in all that what happen after click on button widget can't be set to home screen instead going to menu setting from device click on Add->Widgets->Then my widget Icon after click on my widget icon it will be set to home screen. But i don't need this i want that after click on button from my activity widget will be set to home screen without going here. Add->Widgets->Then my

Android AppWidget Listview change selected imagebutton onClick

梦想与她 提交于 2019-12-11 08:15:58
问题 I've this homescreen widget: It's easy to update for example two buttons next to the logo from activity , because I have their appWidgetIds from onUpdate method from AppWidgetProvider , but imagebuttons in the list are created in RemoteViewsFactory class in getViewAt() method. @Override public RemoteViews getViewAt(int position) { RemoteViews row = new RemoteViews(ctxt.getPackageName(), R.layout.list_row_widget); row.setTextViewText(R.id.tvDescription, items.get(position).name); Intent i =

AppWidget does not reliably update upon call updateAppWidget()

有些话、适合烂在心里 提交于 2019-12-11 08:03:37
问题 I'm creating a fairly common use case of AppWidget on Android. AppWidgetProvider calls onAppWidgetOptionsChanged() (stretchable widget) and onUpdate() (timed) From those methods I start an IntentService . Case coming from options changed I pass the new size in the Intent. The service contacts a web-service, builds the RemoteViews and calls updateAppWidget() my main test device is a Nexus 7 (2012) running stock 4.3 (stock Launcher) The widget does not use RemoteViewFactory and does not user

Detect OnTouch on AppWidget. If is it possible?

依然范特西╮ 提交于 2019-12-10 19:29:50
问题 Detect OnTouch on AppWidget. If is it possible? Hello! I'm trying to create my first AppWidget for Android 2.1 in which a client may have a chance to select an item on my custom view. I'm going to create a custom view and a slider for it and client may select by pulling slider over the custom view. For this purpose I want to detect onTouch for AppWidget (to determine X-, Y- coordinates), is there way to do this? I saw a list of valid widgets which can be used in AppWidget: AnalogClock Button