I've found a solution
First off I implemented Parcelable in my List items (following How can I make my custom objects Parcelable?)
Than I've overwritten startActivity
(thats the only way to pass data to Search Widget)
@Override
public void startActivity(Intent intent) {
// check if search intent
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
intent.putExtra("elementsToSearch", keywordsData);
}
super.startActivity(intent);
}
Make sure that keywordsData is an array of primitives or <? extends Parcelable>
Than in my Search Results activity I've simply called
getIntent().getExtras().getParcelableArrayList("elementsToSearch");