jacksun101
jacksun101

Reputation: 400

Howto read updated shared preferences between applications?

I met an issue very similar with the following, but it's different.

Howto read updated shared preferences?

I've two applications, A.apk has quite a few sharedPreferences need to be fetched from B.apk. I can totally read it from B without a problem. However, when the preferences of A are changed, and then return to B.apk (onResume). Now the preferences fetched from A are not updated. I've to force close the B.apk and restart it to read the updated preferences.

I've also tried to use finish() while leaving A, however, it's not working. Any suggestion?

Upvotes: 1

Views: 260

Answers (1)

Wenhui
Wenhui

Reputation: 658

You can have a ContentProvider in B.apk, and read/updated preferences in A.apk.

Upvotes: 1

Related Questions