Just use your desired layout on the first onUpdate() call of your
AppWidgetProvider. You cannot literally modify android:initialLayout,
or anything inside of a resource, at runtime.

On Thu, May 19, 2011 at 3:06 AM, Perry168 <[email protected]> wrote:
> Hi all,
>
>    Following was the appwidget-provider XML for my widget. About the
> < android:initialLayout="@layout/sc1" >, how to change the "@layout/
> sc1" value in activity(Java)? e.g. change the sc1 to sc2.
>    From this , I hope my widget is more flexible to use different
> layout.
>
> <?xml version="1.0" encoding="utf-8"?>
> <appwidget-provider
>        xmlns:android="http://schemas.android.com/apk/res/android";
>        android:minWidth="150.0dip"
>        android:minHeight="150.0dip"
>        android:updatePeriodMillis="0"
>        android:initialLayout="@layout/sc1"
>        android:configure="com.test.runningtest.Setting"
>        >
> </appwidget-provider>
>
> Thanks a lot!
>
> --
> 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
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
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

Reply via email to