Can I change appwidget-provider XML 's android:initialLayout? How to do?

by Perry168 » Fri, 20 May 2011 09:30:39 GMT


Sponsored Links
 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!

-- 



Can I change appwidget-provider XML 's android:initialLayout? How to do?

by Perry168 » Fri, 20 May 2011 09:30:39 GMT


 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!

-- 


Sponsored Links


Re: Can I change appwidget-provider XML 's android:initialLayout? How to do?

by Mark Murphy » Fri, 20 May 2011 18:08:15 GMT


 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.






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

-- 



Other Threads

1. How To Get Started?

Hi

1) I had downloaded the android-sdk-windows-1.0_r2 and ADT-0.8.0 zip
files to my notebook.
2) I unzip the ADT-0.8.0 zip file to my c: directory and completed the
Installing the SDK part
3) When i am at installing the Eclipse Plugin (ADT) part, i am stuck
as i only have the zip file? where and how do i start Eclipse in order
to proceed with the instructions?

Is there a YouTube tutorial that can show me how to do it?

I am very new to programming.

Thanks

munloong

--~--~---------~--~----~------------~-------~--~----~

2. GPS coords to screen coords

Hi,

I searched this mailing list to know the anwser for this but I cant find it.
I dont want to use a MapActivity/MapView.. I just want to draw gps traces on
a blank background so I cant use getProjection() from MapView.

How can I do this in a simple way?

Thanks and sorry for my poor english.

-- 
Joo Oliveirinha

--~--~---------~--~----~------------~-------~--~----~

3. Why Android?

4. How to run the adb command with the emulator?

5. Is it possible to run ADB shell command from inside an Android app

6. Is it possible to run ADB shell command from inside an Android app

7. How to run the adb command with the emulator?