Menu
  • HOME
  • TAGS

AppWidget with collection - can`t run Config Activity when clicking on widget

android,android-widget,android-pendingintent,android-appwidget

After some investigation I came to a conclusion that if I use collection in appWidget and want to open Config Activity tapping on whole widget container that the best practice is using setPendingIntentTemplate method, even if you dont't want to handle item click but the whole list instead (list container)....

setOnClickFillInIntent Error Handling

android,android-pendingintent,android-appwidget,collectionview

I was able to get a solution for this problem from another forum I also posted the same question. Basically, exception handling for an Intent which is already executed is not possible. But, there is a way to check if a target component (activity, service or receiver) exists for the...

Widget not appearing in widget list

android,android-widget,android-appwidget,appwidgetprovider

It is an issue about the values you set in gulp_widget_info.xml for android:minHeight and android:minWidth. Try to set a smaller values and the widget should appear in the launcher's widget list: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:initialLayout="@layout/layout_widget" android:minHeight="40dip" android:minWidth="40dip" android:updatePeriodMillis="86400000" android:widgetCategory="home_screen" android:resizeMode="none" /> I tested this settings in my phone with Google Now...

How to start an activity in a widget button

android,android-widget,android-appwidget

Change PendingIntent.getBroadcast(getApplicationContext(), 0, loginIntent, Intent.FLAG_ACTIVITY_NEW_TASK) into PendingIntent.getActivity(getApplicationContext(), 0, loginIntent, Intent.FLAG_ACTIVITY_NEW_TASK); ...

Why does my AdapterViewAdapter flicker when used in an AppWidget?

java,android,android-appwidget,android-adapterview

I was also having the same issue and found the solution by chance. This is more like tricky solution. This is actually disabling animation effect by adding an animation with no animation setting. 1.Add two XMLs under anim folder. I would say in.xml and out.xml but you could use any...

Values in Sharedpreferences are only available after app is restarted

android,broadcastreceiver,sharedpreferences,android-appwidget

you save it with "saved widget id " + KEY_WIDGET_CONFIG + widget.getAppwidgetID() and you try to get it with a different key KEY_WIDGET_CONFIG + appwidgetID use the same key to get it...

Adding Android AppWidget just for one Product Flavor

android,gradle,android-appwidget,android-productflavors

So we will have our example packages is as follows for your production and staging builds within the gradle product flavors. productFlavors { production { packageName "x(path).x(path).gradleexample" } staging { packageName "x(path).x(path).gradleexample.staging" } } Here is an example of your folder structure some of which may or may not apply...

Line Divider in Android AppWidget

android,view,android-appwidget

As per the documentation: A RemoteViews object (and, consequently, an App Widget) can support the following layout classes: FrameLayout LinearLayout RelativeLayout GridLayout and the following widget classes: AnalogClock Button Chronometer ImageButton ImageView ProgressBar TextView ViewFlipper ListView GridView StackView AdapterViewFlipper Descendants of these classes are not supported. Hence, when you are...

What does … mean after declaring a widget type?

android,android-appwidget,android-typeface

This is a Java feature called Varargs that allows a parameter list, it's not specific to Android. You can find a similar question here: Java "params" in method signature?...

Why are these state variables in my AppWidgetProvider's onReceive null?

java,android,android-widget,android-appwidget

Your process may be terminated in between invocations of onReceive(). If you wish to hold onto data from a BroadcastReceiver, such as an AppWidgetProvider, do so using some persistent data store (database, SharedPreferences, or other sort of file). Static data members are only a cache, nothing more.

android detect user switching from/to HOME

android,android-appwidget,homescreen

As far as I know, there is no direct API to detect whether HOME is in foreground or background. But the following snippet will tell you whether the user is currently at HOME or not. if (mActivityManager.getRunningTasks().get(0).topActivity.getPackageName().equals("com.android.launcher") { //home } DISCLAIMER: The above code will work only for the default...

AppWidget issue on tablets

android,android-layout,android-appwidget

In order to make a 4x1 cells widget, you need to specify your minWidth and minHeight using the following formula: dpSize = (number of cells * 74) – 2 So mathematically, it should turned out to be: android:minWidth="294dp" android:minHeight="72dp" These dimensions will set the default installation of your widget to...

How can i run methods in AppWidget?

android,android-appwidget

You can't call a method directly, but you can fire an Intent. One way would do this would be to have an Intent send a broadcast, using PendingIntent.getBroadcast. (I'm not sure you need the category in there, but that's how I do that in my own code, so I'm including...

How to avoid to creating multiple widgets in homescreen?

android,android-widget,android-appwidget

By Approaching the above solution, a little change in the AppWidgetConfigurationActivity, public class AppWidgetConfigurationActivity extends ActionBarActivity { int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID; private static final String TAG = AppWidgetConfigurationActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Util.logD(TAG, "---MYAPPWIDGET---"); // setResult(RESULT_CANCELED); Intent intent = getIntent(); Bundle extras = intent.getExtras(); if...

Set App Widget to Home Screen programmatically

android,android-appwidget

i want that after click on button from my activity widget will be set to home screen without going here That is not possible....

How do you find a widget ID without an implemented widget provider?

android,android-appwidget

To update a notification (be it the RemoteView associated with it or any of the notification fields themselves), you must recreate the entire notification, calling notificationManager.notify() with the same id as previously added. That will update the notification in place.

Widget Only Updates Certain Values

android,android-appwidget

I found out that my widget does update correctly but only when I create a new instance of it... Will repost question with more indepth example

Update textView in appWidget android doesnt work properly

android,textview,runnable,android-appwidget

if you are using a layout file like this you need to findViewbyId so instead of creating a new textview like you are change the line to this. timerValue = (TextView) findViewById(R.id.timerValue) you should do the same for your buttons you also need to add action listeners to your buttons...

sending intent with a parcelable extra from widget crashes on activity startup

android,android-intent,android-appwidget,parcelable

For your idInPhone in phone in constructor your are reading it as int set_idInPhone(in.readInt()); But in writeToParcel() method you writing it as long dest.writeLong(get_idInPhone()); Change any one to long or int according to your variable declaration......

How to determine orientation of home screen

android,screen-orientation,android-appwidget,android-orientation,homescreen

Is there a way to determine programmatically the orientation of the home screen? No. The author of the home screen can do whatever the author wants. For all you know, things are displayed on a diagonal. And, since there are hundreds, perhaps thousands, of home screen implementations, the behavior...

Android Homescreen widgets without Java

android,cordova,android-widget,android-appwidget,kivy

You can interact with java from python using pyjnius (a kivy subproject, but it doesn't depend on kivy and can be used without it), including on android calling the apis to create and position native android widgets. For instance, kivy-gmaps is a kivy application that displays and controls a native...

Changing android:updatePeriodMillis programmatically

android,android-appwidget,appwidgetprovider

So I'm just checking that this is still the case. Yes, it is still the case that you cannot update updatePeriodMillis. Which is too bad, as I'd love to see an updateUpdatePeriodMillis() method. Particularly if this were done via some sort of builder or transaction object, implying that it...

How to save the configuration of widgets

android,android-widget,android-appwidget

App Widget configuration Activity is an optional Activity that launches when the user adds your App Widget and allows him or her to modify App Widget settings at create-time. In the configuration Activity you can set up update frequency, text in TextView, background drawable of the widget and so on...

setRotation of TextView in RemoteViews (app widget)

android,rotation,textview,android-appwidget,remoteview

The reason why you are crashing is because setRotation() does not have the @RemotableViewMethod annotation in the Android source code, and therefore it cannot be set using setFloat(). I am not aware of any way for you to change the rotation property of a View dynamically in an app widget....