I have SearchSubCategories function in my android fragment and I am calling this function from MainActivity when SubCategories like food check box click .I wanna search food SubCategories data from my database and wanna set data on RecyclerView.My RecyclerView already showing me data randomly but now I want search some specific SubCategories like food,Chinese food etc. I am passing text to SearchSubCategories function according to which Checkbox checked. But it gives me error Null Object reference please guide me.
public void SearchCategoresFunction(final String searchTxt){
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
dataStoredArrayList.clear();
myRecyclerAdapter.notifyDataSetChanged();
mparser = new SecondParseDataClass(getActivity());
mparser.setOnDataRetrievalCallback(new OnDataRetrievalCallback() {
@Override
public void onDataRetrieval(ArrayList<DataStored> dataSet) {
dataStoredArrayList.addAll(dataSet);
myRecyclerAdapter.notifyDataSetChanged();
}
});
mparser.execute("http://192.168.3.10/fetchtext.php", "2",searchTxt);
}
}, 0);
}
Aucun commentaire:
Enregistrer un commentaire