views:

37

answers:

1

Hello,

I have an app that uses a TabHost. Several of the Tabs share a common HUD. I am using a service to periodically update those values by calling an AIDL function when ready.

However, since several of the Tabs are using the same HUD I would like to abstract that part out.

I thought about having the HUD.xml use a String resource as it's value and then the abstracted class can update the String resource. However, apparently Android can not update String resources programatically.

The only alternative solution I see would be using SharedPreference. I have concerns accessing a Database everytime the value is refreshed.

Can anyone please share some options with me.

Thank you

A: 

However, apparently Android can not update String resources programatically.

Correct.

The only alternative solution I see would be using SharedPreference. I have concerns accessing a Database everytime the value is refreshed.

Shared preferences are not stored in a database. They are stored in an XML file.

Can anyone please share some options with me.

Have the service broadcast an Intent when it changes the data. Or, have the service call listener objects supplied by the tabs. There's probably a half-dozen other options as well, but those two should get you started down the path.

CommonsWare
Thank you very much!
Frank Sposaro