0

Say that there is an App Widget that shows a configuration Activity when placed. The configuration page allows adjusting the appearance of the widget.

The user may place multiple instances of this widget on their home screen. What would be the best way to maintain the unique configuration states on each of the widget instances? Or would each widget instance have to adopt the same global state?

1 Answer 1

1

I know this is an old post, but...

I am doing it by writing a file identified/named as the widgetId. When the phone is rebooted the widgetId is maintained and my widget reads the file. Each time I configure each widget it writes to its own file until the widget is deleted from the screen and recreated.

I have heard that it is best to use SQLlite instead of files, but I have not looked into that yet.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.