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.

inside custom component

Android™ Development

Reply
Highlighted
Regular Contributor
Posts: 63
Registered: ‎12-24-2010
My Device: Torch
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 ?

BlackBerry Development Advisor
Posts: 102
Registered: ‎11-21-2008
My Device: Z10
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
Regular Contributor
Posts: 63
Registered: ‎12-24-2010
My Device: Torch

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.

Regular Contributor
Posts: 63
Registered: ‎12-24-2010
My Device: Torch

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.