I don't think this is possible. Morever, I guess, there is no
practical use of this. AppWidgets are not meant to be put on an
Activity.

Thanks and Regards,
Kumar Bibek

On Mar 19, 11:05 am, Benny <dongdong.w...@gmail.com> wrote:
> Hi, I want to embed the analog clock in my application.
> I use
> <AnalogClock
>              android:layout_width="wrap_content"
>              android:layout_height="wrap_content" />
> in my layout XML file, but the clock's appearance is different from
> the one added in Home screen.
> I know I can copy the AlarmClock's images to my project. And in xml
> file, set the android:dial, android:hand_hour,and android:hand_minute
> to my project's images.
> But I want to know is there a way to directly reference the resource
> in the AnalogClock?
>
> second question,
> Can I add the app widget from code?
> I tried use following code to add a appwidget, but it seems the
> getAppWidgetIds don't work?
> Anybody knows why?
>
>         AppWidgetManager mAppWidgetManager;
>         AppWidgetHost mAppWidgetHost;
>
>          ComponentName THIS_APPWIDGET =new ComponentName("com.android.music",
> "com.android.music.MediaAppWidgetProvider");
>
>             mAppWidgetManager = AppWidgetManager.getInstance(this);
>
>             int[]
> appWidgetId=mAppWidgetManager.getAppWidgetIds(THIS_APPWIDGET);
>             int b=appWidgetId.length;  //always 0 ????

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to