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. Uploading Screen Shots of App to Android Market

Hello Droiddudes and Droidettes,
I'm having some trouble uploading screenshots via the
market.android.com/publish/home dashboard.

Although i've followed the rules about 320 x 480 size for screen shots, +
I've used 24 bit PNG, it still is not accepting any of my screenshots.

I've tried everything.

Why isnt it working?

When it says "no borders" - am I meant to remove the part of the screen shot
that contains the time, battery consumption etc? It is basically a screen
capture of the emulator.

I'm really frustrated and I need some help.

Whose idea was it at Google to limit the app description to 335 characters?
Talk about cruel!!

Thanks, and sorry for whining.

Regards,

Vaz

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

2. Updated apps not showing at the top of the list

I am new to posting on the market, and cant figure this out!

I have run through updating my app a couple of times in the past day
for bug fixes and such that people have found for me, but my app
doesn't seem to be showing up at the top of the "By Date" sort! I know
that I see other peoples apps jump back to the top of that sorting
when they release an update.

Please, can anyone tell me the magic secret on how to make my app do
this?

P.S. I would rather NOT have to lose all of my ratings and followers
by starting a complete new listing. I have thought about it, and
realize that this is not how other people are doing it anyway!

Does it have something to in the manifest? ARRRRRGH! I'm pissed!

Thanks


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

3. Motorola cliq with Motoblur

4. Release of SAM 3.0

5. pointer location app under emulator

6. The <keygen> tag revisite

7. Broadcast Receivers help