OK, here we go:
I have a search interface/ dialog (the type that gets created by the system) This calls FilesList, an activity that when called without a search intent will show all of a users items (This works fine when it is called from the main activity)
The query from the search filters these results fine, but when the user selects one of these results it will return to the previous activity, whereas I want it to always return to the main activity, passing the id of the selected item (Which I can get fine)
Also, in whichever activity I call the search from, onActivityResult is not called (Because the search intent isn't for a result?)
Basically, always return to main activity after search, returning an item selected in FilesList
EDIT:
To select an item the user clicks a listview and calls this method:
protected void onListItemClick(ListView l, View v, int position, long id) {
Log.d("onclick ID", ((Note)data.get(position)).ID);
Note array=(Note)data.get(position);
intent.putExtra("id", array.ID);
intent.putExtra("tag", currentTag);
setResult(RESULT_OK, intent);
finish();
}
And the search is launched like this: http://developer.android.com/guide/topics/search/search-dialog.html