Fixed issue when downloaded map doesn't show in localIndex
This commit is contained in:
parent
274796d5c3
commit
5073e82918
2 changed files with 14 additions and 6 deletions
|
@ -100,7 +100,6 @@ public class DownloadActivity extends SherlockFragmentActivity {
|
|||
|
||||
tabHost.setCurrentTab(0);
|
||||
|
||||
|
||||
settings = ((OsmandApplication)getApplication()).getSettings();
|
||||
|
||||
indeterminateProgressBar = (ProgressBar) findViewById(R.id.IndeterminateProgressBar);
|
||||
|
@ -448,7 +447,11 @@ public class DownloadActivity extends SherlockFragmentActivity {
|
|||
public void downloadedIndexes(){
|
||||
for(WeakReference<Fragment> ref : fragList) {
|
||||
Fragment f = ref.get();
|
||||
if(f instanceof DownloadIndexFragment) {
|
||||
if(f instanceof LocalIndexesFragment){
|
||||
if(!f.isDetached()){
|
||||
((LocalIndexesFragment) f).reloadData();
|
||||
}
|
||||
} else if(f instanceof DownloadIndexFragment) {
|
||||
if(!f.isDetached()) {
|
||||
DownloadIndexAdapter adapter = ((DownloadIndexAdapter)((DownloadIndexFragment) f).getExpandableListAdapter());
|
||||
if (adapter != null) {
|
||||
|
|
|
@ -114,8 +114,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
public void onResume() {
|
||||
super.onResume();
|
||||
if (asyncLoader == null || asyncLoader.getResult() == null) {
|
||||
asyncLoader = new LoadLocalIndexTask();
|
||||
asyncLoader.execute(getActivity());
|
||||
reloadData();
|
||||
}
|
||||
|
||||
getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
|
||||
|
@ -131,8 +130,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void reloadData() {
|
||||
asyncLoader = new LoadLocalIndexTask();
|
||||
asyncLoader.execute(getActivity());
|
||||
}
|
||||
|
||||
|
||||
private void showContextMenu(final LocalIndexInfo info) {
|
||||
Builder builder = new AlertDialog.Builder(getActivity());
|
||||
final ContextMenuAdapter adapter = new ContextMenuAdapter(getActivity());
|
||||
|
@ -241,6 +245,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
|
|||
@Override
|
||||
protected void onPreExecute() {
|
||||
getDownloadActivity().setSupportProgressBarIndeterminateVisibility(true);
|
||||
listAdapter.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue