Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Search Manaager

Search Manaager

Put your problem here if it does not fit any of the other categories.

Search Manaager

Postby ayden » Tue Mar 10, 2009 12:14 pm

I'm trying to use search manager now.
and my partial code is as below:

Intent search = new Intent(Intent,ACTION_SEARCH);
search.putExtra(SearchManager.QUERY, query_string);
startActivity(search);

It would popup a dialog that lists all applicatons that have "ACTION_SEARCH" in AndroidMenifest.xml,
ex: Contacts, Google Search...
After choosing "Contacs", it would return the result of searching Contacts.

Is there a way that i can set the intent to search Contacts directly without the popup dialog?

thanks
ayden
Freshman
Freshman
 
Posts: 6
Joined: Fri Mar 06, 2009 10:56 am

Top

Postby ayden » Wed Mar 11, 2009 5:00 am

Reply question by myself :P

intent should use setComponent(package name, class name) to set which application you want to search.

code should look like this:

Intent search = new Intent(Intent,ACTION_SEARCH);
search.setComponent(new Component(package name, class name));
search.putExtra(SearchManager.QUERY, query_string);
startActivity(search);

Therefore, you can search the appication you want directly.
ayden
Freshman
Freshman
 
Posts: 6
Joined: Fri Mar 06, 2009 10:56 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 7 guests