Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes and their values are not getting saved properly in preferences.text #700

Closed
rupeshkumar22 opened this issue Jul 4, 2022 · 3 comments

Comments

@rupeshkumar22
Copy link
Contributor

It's strange that Preferences.set("android.sdk.path", folder.getAbsolutePath());
not committing the changes to the preferences.txt file. During runtime if logs are used- Preferences.get("android.sdk.path") returns the correct value just after Preferences.set("android.sdk.path", folder.getAbsolutePath());
But after closing the program Preferences.txt file does not contain the attribute and value. So the next time on program startup load returns null as the value was not stored earlier in preferences.txt file not even with Preferences.set("android.sdk.path", folder.getAbsolutePath());

Steps to reproduce-
Remove the variable ANDROID_SDK from eclipse if using, and delete the preferences.txt folder. Remove any system environment with ANDROID_SDK if present.
On startup, it shows "cannot find an Android SDK" dialog box. Choose any option either "choose sdk path mannually" or "download SDK automatically. After the process, values are not getting saved as "android.sdk.path" in the preferences.txt file.
Restarting the program opens the same dialog again and Preferences.get("android.sdk.path") returns null on logs. I have confirmed the SDK path was used without any space in Preference.set and was accessible by Preferences.get on runtime.

@codeanticode
Copy link
Member

codeanticode commented Jul 5, 2022

@rupeshkumar22 I think the issue is that Preferences.set() does not save the preferences to the file immediately, the PDE writes to the preferences.txt file only on exit.

@rupeshkumar22
Copy link
Contributor Author

@codeanticode thanks for the information, I checked the file after closing PDE window. Might be the case that process was running in background. I will check again. Thanks!

@rupeshkumar22
Copy link
Contributor Author

After closing the PDE properly, The values were getting saved, Thanks for the information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants