You can have an application + homescreen widget in a single .apk. Make sure your main application has the intent-filter android:name="android.intent.action.MAIN" and android:name="android.intent.category.LAUNCHER". Your widget receivers/activities instead shouldn't have any intent-filters with name MAIN (they should of course have the APPWIDGET_UPDATE/APPWIDGET_CONFIGURE/..).
Yuvi -- YuviDroid http://android.yuvalsharon.net On Mon, Jun 28, 2010 at 11:59 PM, Pinheiro <[email protected]> wrote: > I've created a complex application that uses SQLite and would like to > give the user an option to install a very simple widget on the > homescreen (just a number taken from the database). > > Do I have to create a new .apk just for the widget? I've tried to cut- > and-paste the WordWidget example but it takes over the application > (does nothing when started) and after installing the widget any click > on it gives an exception "View not attached to window manager". If I > have to create a new .apk just for the widget, will it be able to > access directly the databases from my "main" application? > > Thanks in advance! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

