This is deliberately not available to applications. If you want to add a widget, you need to launch the selector UI for the user to pick the widget which will then take care of the bind. Widgets can expose a lot of private data of all types, so it is not safe to allow an application to arbitrarily bind to them without the user implicitly approving (through the selection UI).
On Sun, Nov 8, 2009 at 5:47 AM, Kerr <[email protected]> wrote: > Well, Why we want use bindAppWidgetId()? > Generally, when you want to add some widgets on desktop(Launcher), you > just could longClick and select widget you want. But if you want > create some default widgets on desktop, you must need to use > bindAppWidgetId(), the woking flow is like this > 1, widget host create a wdigetId. > 2, bindAppWidgetId() to that widgetId > 3, Add the host view to desktop using createView() > > But in Launcher project, the logcat output securityException..., it > said the pid user don't have the BIND_WIDGET permission. You know > BIND_WIDGET permission is just for WidgetPicker Activity > (DialogActivity), it's not for use bindAppWidgetId() function. I also > try to change the makefile of Launcher to modify the CERTIFICATE from > "shared" to "platform" as the Setting project use, but it also failed. > > So my final method is to add some function in Setting project which > could accomplish bindAppWidgetId(), but this method is not a general > way. > > Could the android team direct how to use bindAppWidgetId() for a > general application? > > Yuandan Kerr > > -- > 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 > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

