搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

Directly start firefox on buttonclick event with URL passed to it

  • 無回覆
  • 10 有這個問題
  • 11 次檢視
more options

I have an URL to be opened directly (will check if installed or not) in Firefox android browser only, for the button click event.....But my code opens dialog to choose browser(URL is passed)

               if(isAppInstalled) {
                   Uri uri = Uri.parse("http://localhost/rtc.html"); 
                   Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                   startActivity(intent);
OR just opens firefox (if installed) but URL is not passed to it
 Intent intent1=getPackageManager().getLaunchIntentForPackage("com.mozilla.firefox");
                   startActivity(intent1);

So how do I open firefox directly with URL passed to it.

I have an URL to be opened directly (will check if installed or not) in Firefox android browser only, for the button click event.....But my code opens dialog to choose browser(URL is passed) if(isAppInstalled) { Uri uri = Uri.parse("http://localhost/rtc.html"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); OR just opens firefox (if installed) but URL is not passed to it Intent intent1=getPackageManager().getLaunchIntentForPackage("com.mozilla.firefox"); startActivity(intent1); So how do I open firefox directly with URL passed to it.