Fixed null pointer and some more refactor

This commit is contained in:
Denis 2014-09-09 17:02:38 +03:00
parent 836169da20
commit 947ae262af
2 changed files with 19 additions and 1 deletions

View file

@ -576,7 +576,7 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment {
@Override
public void onDestroy() {
super.onDestroy();
if (textWatcher != null) {
if (textWatcher != null && getView() != null) {
EditText filterText = (EditText) getView().findViewById(R.id.search_box);
filterText.removeTextChangedListener(textWatcher);
}

View file

@ -1,18 +1,36 @@
package net.osmand.plus.download;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;
import net.osmand.plus.activities.OsmandExpandableListFragment;
import java.util.List;
import java.util.Map;
/**
* Created by Denis on 09.09.2014.
*/
public class UpdatesIndexFragment extends OsmandExpandableListFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onResume() {
super.onResume();
Map<IndexItem, List<DownloadEntry>> map = getDownloadActivity().getEntriesToDownload();
}
@Override
public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i2, long l) {
return false;
}
public DownloadActivity getDownloadActivity() { return (DownloadActivity)getActivity(); }
}