• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Retrieving global search results in the code from android global searchable dialog

mhelal

Lurker
Oct 28, 2013
2
0
Hi,

I am trying to develop a web crawler to using Android searchable following this guide:

Creating a Search Interface | Android Developers

So far, the search results display a new browser screen to display the google results. The guide says that I can get the results in a ListActivity using a ListAdapter. All examples I have seen describe how to create this Adapter for q query from database or contacts on phone, such as:

public class MyListAdapter extends ListActivity {

@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);

// We'll define a custom screen layout here (the one shown above), but
// typically, you could just use the standard ListActivity layout.
setContentView(R.layout.custom_list_activity_view);

// Query for all people contacts using the Contacts.People convenience class.
// Put a managed wrapper around the retrieved cursor so we don't have to worry about
// requerying or closing it as the activity changes state.
mCursor = this.getContentResolver().query(People.CONTENT_URI, null, null, null, null);
startManagingCursor(mCursor);

// Now create a new list adapter bound to the cursor.
// SimpleListAdapter is designed for binding to a Cursor.
ListAdapter adapter = new SimpleCursorAdapter(
this, // Context.
android.R.layout.two_line_list_item, // Specify the row template to use (here, two columns bound to the two retrieved cursor
rows).
mCursor, // Pass in the cursor to bind to.
new String[] {People.NAME, People.COMPANY}, // Array of cursor columns to bind to.
new int[] {android.R.id.text1, android.R.id.text2}); // Parallel array of which template objects to bind to those columns.

// Bind to our new adapter.
setListAdapter(adapter);
}
}

I couldn't find anything to declare a cursor to read from the global search results. I appreciate any help I can get to retrieve the global search results programatically to be able to process it and produce a report about the results, not just the mere listings,

Thank you very much for your help,
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones