5

I am making an android application, in which I want to open the browser via an intent for a specific URL on button click; I am using following code for this:

String url = finalUrl2;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

This is opening the browser with its address bar, but I want that the browser opens without its address bar.

I don't want to use a web view in this case, because of some reasons; I want to open the Browser without its address bar.

Please tell me the way of doing this. If this is possible only in rooted mobiles, then please tell me the way of doing this in rooted mobiles.

Thanks.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
mark
  • 503
  • 5
  • 27
  • 1
    I think this is only possible if you add javascript to the page that is displayed. See also [this question](http://stackoverflow.com/q/4068559/741249). Also the exact solution may be browser dependent. – THelper Dec 05 '13 at 12:16
  • @THelper thanks for your reply, can you give me brief idea, how to apply your given suggestion in my code, I mean how to apply javascript code while I am opening browser via intent. Thank you . – mark Dec 05 '13 at 12:37
  • Check the link in my previous comment, take the code from either the first or second answer (both will work). Add that code to the webpage you want to display. – THelper Dec 05 '13 at 12:48
  • Show me your research what you have did till now. – MouseCrasher Dec 05 '13 at 12:49
  • @MouseCrasher .. I researched a lot, and not able to find the answer regarding in build browser, I only got the answers regarding WebViews. – mark Dec 05 '13 at 12:50
  • you are trying to get code from other user directly. I don't think so it's a good approach. Here buddy help you by yourself. – MouseCrasher Dec 05 '13 at 12:51
  • I am not trying to get complete code from others, I am just asking idea about that, I am asking that, it is possible in rooted or non rooted devices or not. But anyways, you are absolutely right, this is not good approach to asking direct questions, and I never follow that. – mark Dec 05 '13 at 12:54
  • Thanks all for your valuable reply, but my problem is that, I don't want to open URL in **webview**, I want to use android's **inbuilt browser** for opening that URL. And according to above given replays, I need to implement java script on webpage that I want to open, and that is only possible when I use **webviews** in my application, but I don't want to use webviews, I want to open URL in browser only. Thanks. – mark Dec 06 '13 at 07:24
  • 1
    If you don't control the webpage that is displayed and if you don't want to use webview, then it is impossible. – THelper Dec 06 '13 at 08:08

1 Answers1

0

Maybe try opening a local html file which you can use to insert your javascript code and then load the page that you want to browse in an iframe?

hoomi
  • 1,882
  • 2
  • 16
  • 17