Fixed issue when downloaded map doesn't show in localIndex

This commit is contained in:
Denis 2014-11-17 13:27:44 +02:00
parent 274796d5c3
commit 5073e82918
2 changed files with 14 additions and 6 deletions

View file

@ -100,7 +100,6 @@ public class DownloadActivity extends SherlockFragmentActivity {
tabHost.setCurrentTab(0); tabHost.setCurrentTab(0);
settings = ((OsmandApplication)getApplication()).getSettings(); settings = ((OsmandApplication)getApplication()).getSettings();
indeterminateProgressBar = (ProgressBar) findViewById(R.id.IndeterminateProgressBar); indeterminateProgressBar = (ProgressBar) findViewById(R.id.IndeterminateProgressBar);
@ -448,7 +447,11 @@ public class DownloadActivity extends SherlockFragmentActivity {
public void downloadedIndexes(){ public void downloadedIndexes(){
for(WeakReference<Fragment> ref : fragList) { for(WeakReference<Fragment> ref : fragList) {
Fragment f = ref.get(); 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()) { if(!f.isDetached()) {
DownloadIndexAdapter adapter = ((DownloadIndexAdapter)((DownloadIndexFragment) f).getExpandableListAdapter()); DownloadIndexAdapter adapter = ((DownloadIndexAdapter)((DownloadIndexFragment) f).getExpandableListAdapter());
if (adapter != null) { if (adapter != null) {

View file

@ -114,8 +114,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (asyncLoader == null || asyncLoader.getResult() == null) { if (asyncLoader == null || asyncLoader.getResult() == null) {
asyncLoader = new LoadLocalIndexTask(); reloadData();
asyncLoader.execute(getActivity());
} }
getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() { getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
@ -132,6 +131,11 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
}); });
} }
public void reloadData() {
asyncLoader = new LoadLocalIndexTask();
asyncLoader.execute(getActivity());
}
private void showContextMenu(final LocalIndexInfo info) { private void showContextMenu(final LocalIndexInfo info) {
Builder builder = new AlertDialog.Builder(getActivity()); Builder builder = new AlertDialog.Builder(getActivity());
@ -241,6 +245,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
@Override @Override
protected void onPreExecute() { protected void onPreExecute() {
getDownloadActivity().setSupportProgressBarIndeterminateVisibility(true); getDownloadActivity().setSupportProgressBarIndeterminateVisibility(true);
listAdapter.clear();
} }
@Override @Override