try isDetaehd() again

This commit is contained in:
sonora 2014-12-21 11:41:52 +01:00
parent b91a5ce217
commit 59e206463c

View file

@ -478,15 +478,18 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (this.isDetached()) {
return;
}
//fixes issue when local files not shown after switching tabs
//TODO: But this throws NPE in some circumstances and needs fixing, so commented out for now
//if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0){
// for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()){
// listAdapter.addLocalIndexInfo(info);
// }
// listAdapter.sortData();
// getExpandableListView().setAdapter(listAdapter);
//}
if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) {
for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) {
listAdapter.addLocalIndexInfo(info);
}
listAdapter.sortData();
getExpandableListView().setAdapter(listAdapter);
}
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
//hide action bar from downloadindexfragment
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);