bug:when change language,the application's label not follow change it's lable display in Launcher
resolve:change ApplicationsAdapter's add methode to:
@Override
public void add(ApplicationInfo info) {
//check allItems before added. It is a fix for all of the multi-icon issue, but will
//lose performance. Anyway, we do not expected to have many applications.
synchronized (allItems) {
/if (!allItems.contains(info)) {
changed = true;
allItems.add(info);
Collections.sort(allItems,new ApplicationInfoComparator());
}/
int count=allItems.size();
boolean found=false;
for(int i=0;i<count;i++){
ApplicationInfo athis=allItems.get(i);
if(info.intent.getComponent()!=null){
if(athis.intent.getComponent().flattenToString().equals(
info.intent.getComponent().flattenToString())){
found=true;
if(!athis.title.equals(info.title)){
viewCache.remove(athis);
allItems.remove(i);
Collections.sort(allItems,new ApplicationInfoComparator());
updateDataSet();
found=false;
}
break;
}
}
}
if(!found){
allItems.add(info);
Collections.sort(allItems,new ApplicationInfoComparator());
updateDataSet();
}
}
}
bug:when change language,the application's label not follow change it's lable display in Launcher resolve:change ApplicationsAdapter's add methode to: @Override public void add(ApplicationInfo info) { //check allItems before added. It is a fix for all of the multi-icon issue, but will //lose performance. Anyway, we do not expected to have many applications. synchronized (allItems) { /if (!allItems.contains(info)) { changed = true; allItems.add(info); Collections.sort(allItems,new ApplicationInfoComparator()); }/ int count=allItems.size(); boolean found=false; for(int i=0;i<count;i++){ ApplicationInfo athis=allItems.get(i); if(info.intent.getComponent()!=null){ if(athis.intent.getComponent().flattenToString().equals( info.intent.getComponent().flattenToString())){ found=true; if(!athis.title.equals(info.title)){ viewCache.remove(athis); allItems.remove(i); Collections.sort(allItems,new ApplicationInfoComparator()); updateDataSet(); found=false; } break; } } } if(!found){ allItems.add(info); Collections.sort(allItems,new ApplicationInfoComparator()); updateDataSet(); } } }