android-appwidget

Calculate height of appwidget

て烟熏妆下的殇ゞ 提交于 2020-01-29 08:01:26
问题 I cannot figure out or find a solution by googling for this problem. I have an android app with an appwidget, looks like http://www.livescorewidget.eu/img/screendumps/widget.png, and I am adding the data rows on the fly. Due to different devices the height of the widget is different and therefore a different amount of space is available for my rows. I want to know how many dips or pixels my widget uses so I can calculate how many rows there is room for. Is it possible? Even better could be if

Handling multiple instances of appwidget

风流意气都作罢 提交于 2020-01-22 10:29:34
问题 I have a configuration activity, a large widget provider and a small widget provider. From configuration activity i save some values in shared preferences. From large and small app widget providers i get those shared preferences. I am not able to give the app widget unique ids and i want to have different shared preferences each time i move on from configuration activity to app widget provider. How can i achieve this. 回答1: To give unique widget ids for each instances of the app widget, you

listview in app widget android

寵の児 提交于 2020-01-16 05:51:10
问题 hi friends enter link description here this link to create list view widget for my app, but here i want to add a button below the list view ,which on click will open my app, using the below code to acheive this,because it worked for me on other app, but not with this example, how to do that . class widgetprovider public class WidgetProvider extends AppWidgetProvider { // String to be sent on Broadcast as soon as Data is Fetched // should be included on WidgetProvider manifest intent action //

Android appwidget remoteviews not updating

北战南征 提交于 2020-01-13 05:58:46
问题 List remote view is not updating (I mean refreshing itself) when I am updating the widget from some activity. It comes up till onUpdate of app widget (log showing up). but does not enter into adaptor of list view to inflate it with fresh data . public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int N = appWidgetIds.length; for (int i = 0; i < N; i++) { int appWidgetId = appWidgetIds[i]; Log.e("called", "onupdate"); RemoteViews views = new

How can I fill an ImageView in an Appwidget while mainiting the aspect ratio?

半腔热情 提交于 2020-01-06 08:21:28
问题 I have a simple widget containing an ImageView . I'd like to fetch an image from the web and display it in the ImageView while maintaining the aspect ratio. Here's the layout definition for the widget: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/quality_image" android:layout_width="fill_parent"

Any AppWidgetHost-tutorials out there?

﹥>﹥吖頭↗ 提交于 2020-01-06 03:18:10
问题 I'm writing an application that should both have the ability to place widgets on the home screen, and to show these widgets in the application itself. I figure that the best way to do this is through the use of an AppWidgetHost for the application part. I've been looking around, but I cannot find any good examples on how to write AppWidgetHosts. Have any of you done this, and are willing to share? Or do you know of any tutorials that I've missed? 回答1: Not exactly a tutorial but here is an

Getting a String to AppWidget via GetExtras (or) Shared prefrences

落爺英雄遲暮 提交于 2020-01-03 02:42:04
问题 I have an app widged which basically has a textview. I also have an activity which displays a textview from string created within. Now i have a button in Activity 1 which onClick will send data (string to appWidget class) I tried putExtra and getExtra methods and also Shared preferences method, im little confused to use which first! Here are some inputs from me for more clarity. Activity1: final String addwidget = ((TextView)findViewById(R.id.verse)).getText().toString(); Intent widgetIntent

Android;Force AppWidget to work from SD Card?

无人久伴 提交于 2020-01-02 08:34:41
问题 Is there any way to force AppWidget to work even App is moved to the SD Card and SD Card is not unmounted ? Docs say: ... you should not allow your application to be installed on the external storage if it uses any of the following features, due to the cited consequences when the external storage is unmounted : ... App Widgets Your App Widget will be removed from the home screen. When external storage is remounted, your App Widget will not be available for the user to select until the system

Update app widget on click in android

大城市里の小女人 提交于 2020-01-02 05:47:08
问题 I am working on Android Widget my widget is like following diagram, [prev] event name [next] prev, next are the buttons on the widget.So i want to update the event name on click of next and prev button.On start of the service i loaded the data and stored it in array list. Now i want to iterate through the array list by clicking the next and prev buttons on the widget. So how can i achieve this.Please help me with proper solution. Here is my xml layout <LinearLayout android:id="@+id/lytWidget2

Android Lollipop: Launcher crashes when adding app widget to Home Screen

╄→гoц情女王★ 提交于 2020-01-02 04:31:09
问题 The Launcher crashes on Android Lollipop when adding a Widget giving the following message (It works fine on previous Android versions): Edit: This only happens in landscape orientation. 12-16 12:35:10.208: E/AndroidRuntime(960): java.lang.RuntimeException: Unable to resume activity {com.android.launcher/com.android.launcher2.Launcher}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=5, result=-1, data=Intent { (has extras) }} to activity {com.android