When sharing SharedPreference among activities, pay more attention!

Generally, we update SharedPreference by its editor;

Then we use putXXX to update the value in it.

Finally, commit the change to save it to file. We often do it in onStop() or onDestroy()

It’s OK in one activity. But if multiple activities get the same preference, you need pay more attention. Since after committing, the previous settings, especially updated by other activities, may be lost. You may need a class to do updating/committing if you only want one preference. Or you can have multiple SharedPreference.

在Android App里分享二进制文件

在Android App里想向别的程序分享二进制文件很简单,下面是段分享声音文件的例子。