What I'm trying to do is have a clock widget of different sizes (i.e. 2x2, 3x3, 4x4 etc) in one apk and a configuration activity to be able to select which size to add.
From what i've learned from documentation:
So it seems that size is a property of AppWidgetProvider and I'll need to somehow create another provider from the code in configuration Activity of the first one... Or am I getting this wrong and there's another way?
Is this possible at all? :) I've been told that some widgets can do this :)
Thanks in advance!
P.S. I have read this and this. First one explains how to put multiple wigets in one apk, but it's not clear how to select between them in runtime. Second one is about changing layouts, but not size...
Select Apps and widgets that you want to add to the home screen. Make sure you switch to Widgets on the screen that is opening up. Find the Multicon widgets and select the one you want to use by holding down your finger on it and moving it to the location you want it to be displayed.
Smart Widgets are the Android equivalent to stackable widgets in iOS. They allow you to select multiple widgets and combine them into one, accessible by swiping through the stack to access what you need.
Unless the app where the Widget is coming from allows duplicate instances (or if the widget is a system one included with the launcher and is limited to one), there is no way to add two.
Do you really have to do this at runtime? It is possible to define several widgets in one .apk.
Maybe you can have a look on transdroid source? They are including two sizes of a widget in the same package.
AndroidManifest.xml used by Transdroid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With