Hello this is my code
String url = "http://en.wikipedia.org/w/index.php?title=Special%%3ASearch&search="+q.getAuthor().replace(" ","%20")+"";
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
but it is not showing the result instead it shows web page you requested is temporarily down
is there anything wrong with the code or what
thanks in advance…
He shouldn’t need the Internet permission since this is just launching an intent that the browser is going to pick up.
my guess is either that your device is offline (no 3g/4g, and no wifi) or your url is not working correctly.
make a log statement that prints your url before you parse it to a uri. Then copy the url out of your log and paste it into a browser and see if it loads.
You might consider not doing the urlencoding manually with
String.replace();Java provides you with URLEncoder which has static methods that will handle the encoding for you.
Just encode all of your parameter and then append them to your base url.