Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Android™ Runtime Development

Reply
Regular Contributor
Utumno
Posts: 63
Registered: ‎12-24-2010
Accepted Solution

SharedPreferences

Actually there's another glitch ( apart from Accelerometer orientation, which I am talking about in another thread ) : SharedPreferences.

 

SharedPreferences is in Android Land AFAIK the most common way to save app preferences. In the Playbook, they work only as long as the Android Runtime is running; once one closes it, all the SharedPreferences are gone, too.

 

More precisely:

 

- launch Android app for the first time

- close it. It will create a SharedPreferences object (let's say, to save it's state)

- you will see the Android Runtime open with all your Anrdoid Apps inside it.

- reopen the app. It will correctly find the SharedPreferences object and read it. All is good so far!

- now close the app

- close the whole Android Runtime

- reopen the app from Home Screen

- the app will not find it's SharedPreferences. Looks like they've been lost with the Runtime

 

 

Is the above expected with my 2.0.0.4869 ?

Please use plain text.
BlackBerry Development Advisor
jdreher
Posts: 65
Registered: ‎11-21-2008
My Carrier: Bell

Re: SharedPreferences

Hello Utumno,

 

Thank you for repoting this. I am unable to reproduce this issue on my end. Upon closing the runtime as well as device restarts, the SharedPreferences objects are still being retained.


If you could please submit a bug report through the following URL, it would allow us to further investigate the issue at hand.

 

BlackBerry Developer Issue Tracker - Create Issue

https://www.blackberry.com/jira/secure/CreateIssue!default.jspa

James Dreher
BlackBerry Development Advisor
Please use plain text.
Regular Contributor
Utumno
Posts: 63
Registered: ‎12-24-2010

Re: SharedPreferences

ok, since you're saying it is supposed to work with the current 2.0.0.4869, I'll investigate this issue in more detail and get back here.

Please use plain text.
Regular Contributor
Utumno
Posts: 63
Registered: ‎12-24-2010

Re: SharedPreferences

Ok, I upgraded to 2.0.0.6149 and it indeed works now . In 2.0.0.4869 it most definately did not work.

Please use plain text.