开发者

Android Browser application hide url

I am abandoning the webview version of my simplified and switching to the default browser to produce my app开发者_StackOverflow中文版. I've already found that using the browser to allow video and audio sources to play with the default media player is the best working solution to my issue however the one important item I would like to implement is to have the url bar not appear. I was almost sure that the solution was to place tell my manifest:

android:theme="@android:style/Theme.NoTitleBar"

but that didn't work. The only solution that I find here is stack overflow is also android:theme="@android:style/Theme.NoTitleBar".

Oh help me Stackoverflow Jedi Knights, you're my only hope.

package com.AFMoB.AlphaPlayerTester;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

public class AlphaPlayerTester extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Uri uriUrl = Uri.parse("http://myapp.com/doit"); 
        Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl);
        startActivity(launchBrowser);
    }
} 


Once you launch the browser independently (as opposed to host a WebView), you can't control of its appearance. There might be some setExtras that can control some behavior (I do not know about that), but most probably the apps you saw are implementing a Webview instead.

Definitely, the browser will not be modified by your manifest file, as it is an independent application. The URI will start the default browser for each device, which only in some will be the android browser. It could be any other browser the user decided to use instead.


Nope you can't do it, you can't even guarantee what browser the user will have installed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜