In Chinese mode, go to the first interface of the image library to view all album sets. Press the home Key, set the language of the mobile phone to English, and then return to the image library to view that the album name is still Chinese. How to update the album name in the Image Library after changing the language on your mobile phone
1. google default is designed to obtain the album name based on the resource type in the constructor for creating each album. Therefore, when the image library is paused (onPause is executed) and enters again, the language is not updated in time.
2. The idea is to re-obtain the album name based on the corresponding resource type when you enter the image library again. The specific modification method is as follows:
(1) In Gallery2 \ src \ com \ android \ gallery3d \ data \ LocalMergeAlbum. javaLocalMergeAlbum. java:
@ Override
Public String getName (){
MName = mSources. length = 0? "": MSources [0]. getName ();
Return mName;
}
(2) In Gallery2 \ src \ com \ android \ gallery3d \ data \ LocalAlbum. java:
First, modify: Define a String variable:
Private String mTempName;
Modify the second part: In the LocalAlbum constructor:
Public LocalAlbum (Path path, GalleryApp application, int bucketId, boolean isImage, String name ){
...
MName = getLocalizedName (application. getResources (), bucketId, name );
MTempName = mName ;...
}
Third, modify the refreshName () method ()
Public void refreshName (String Name ){
MTempName = getLocalizedName (mApplication. getResources (), mBucketId, Name );
}
Modify the fourth part: In the getName () method:
@ Override
Public String getName (){
Refresh (mTempName );
// Return mName;
Return mTempName;
}