i have implement in my application the search method onSearchRequested()
via list and it work well and i create 2 activity one for list data and
another for the search result in that form
public class acitvity1 extends InterfaceBase {
@Override
ListAdapter makeMeAnAdapter(Intent intent) {
return(new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items));
}
}
and the activity 2 who include the search result
public abstract class Acitvity2 extends InterfaceBase {
@Override
ListAdapter makeMeAnAdapter(Intent intent) {
ListAdapter adapter=null;
if (intent.getAction().equals(Intent.ACTION_SEARCH)) {
String query=intent.getStringExtra(SearchManager.QUERY);
List<String> results=searchItems(query);
adapter=new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results);
setTitle("Search : "+query);
}
return(adapter);
}
private List<String> searchItems(String query) {
SearchSuggestionProvider
.getBridge(this)
.saveRecentQuery(query, null);
List<String> results=new ArrayList<String>();
for (String item : items) {
if (item.indexOf(query)>-1) {
results.add(item);
}
}
return(results);
}
so its there a possible to make the search result appear in callback
activity mean in the activity1 and is there any change should do in the
manifest file too thx for help
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en