Thanks a lot! Could you give me a hint? I just know to use RemoteViews(getPackageName(),R.Layout.LO1) to change the layout. About AppWidgetProvider XML, i had try to use (getPackageName(),R.xml.sc1), but I failed.
On 5月20日, 下午6時07分, Mark Murphy <mmur...@commonsware.com> wrote: > 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<perry...@netvigator.com> 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 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 > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://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 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