I want to implement a search function that open the default browser and search the passed string
public void searchOnGoogle(String keywords){
---
}
Is there a way using intent filter or I must implement everything by myself?
String query = URLEncoder.encode(keywords, "utf-8");
String url = "http://www.google.com/search?q=" + query;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With