I'm doing a app which allow user to search on the server. how can i get the text from the Quick Search Box and send to server?
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
     String search= intent.getStringExtra(SearchManager.QUERY);
}
the string "search" is it the text which typing by user?
P/S: sorry about my bad english. Hope you guys und开发者_如何学编程erstand what's I'm talking about. Thanks.
Regard
Wynix
Yes, the String "search" is the string the user has searched for.
Once you have this you can send a request to your server using an HttpGet-object:
HttpGet get = new HttpGet("http://yourserver.com" + search);
HttpResponse response = null;
try {
  response = client.execute(get);
}
catch (IOException e) {}
catch (ClientProtocolException e) {}
Then you can parse the result from the HttpResponse-object:
String result = EntityUtils.toString(response.getEntity());
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论