views:

28

answers:

1

I have a widget that displays a set of information. What I would like to do is to give the user the opportunity to choose the background color/image. I would like to have a popup when the user is selecting the widget to choose the background.

So how would I make the popup?

And how would I apply the background dynamically?

Thank you for any help you can give!!

A: 

I haven't done this specifically before but I would go about it in the following manner:

  • If you are looking to pick up files that are already on the system, fire an intent to pick (ACTION_PICK) and supply the right Intent.data element
  • If you are supplying the options:
    • Create a Dialog with a list view (of image view / text view (with compound drawables and some text)) to select the background
    • Store the value returned into a preference file
    • Read from preference and apply Background

Hope this helps

Sameer Segal
I see how that suggests a way to prompt the user, but I don't understand how to actually implement the background change.
I have since found the android:configure options. Thanks :-)
@atolar, it will be great if you can elaborate on that. I for one will be interested in finding out more about these options
Sameer Segal
http://developer.android.com/guide/topics/appwidgets/index.html#Configuring has information about a configuration activity for the widget.