I have created a SearchActivity based on a RecyclerView that should search through an ArrayList<> that I have declared in my MainActivity
public class SearchActivity extends ListActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        handleIntent(getIntent());
    }
    public void onNewIntent(Intent intent) {
        setIntent(intent);
        handleIntent(intent);
    }
    public void onListItemClick(ListView l, View v, int position, long id) {
        //DA IMPLEMENTARE: chiama accordo activity
        // do not care about this method, I'll implement it later
    }
    private void handleIntent(Intent intent) {
        if(Intent.ACTION_SEARCH.equals(intent.getAction())) {
            String query = intent.getStringExtra(SearchManager.QUERY);
            doSearch(query);
        }
    }
    private void doSearch(String queryStr) {
        // I think I should implement an adapter here
    }
}
I think I should implement something in the doSearch() method, but I do not know how to do it. I'd really appreciate if you could help me out
 
     
    