Fixed NullpointerException in TagListFragment

This commit is contained in:
daniel oeh 2014-08-12 16:46:01 +02:00
parent 57c70871b6
commit cf1e9cb59b
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package de.danoeh.antennapod.fragment.gpodnet;
import android.app.Activity;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
@ -43,8 +44,11 @@ public class TagListFragment extends ListFragment {
sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
sv.clearFocus();
((MainActivity) getActivity()).loadChildFragment(SearchListFragment.newInstance(s));
Activity activity = getActivity();
if (activity != null) {
sv.clearFocus();
((MainActivity) activity).loadChildFragment(SearchListFragment.newInstance(s));
}
return true;
}