아래 코드를 참조하십시오. 내 질문에 지정한 코드를 적용하고 내 알림 표시 줄이 숨겨져 있습니다. 외부 브라우저 응용 프로그램에 대한 알림 표시 줄을 비활성화 할 수 없습니다.
public class ContentBrowser extends Activity {
private LinearLayout _progressBarLayout;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.browserlayout);
Bundle receiveBundle = this.getIntent().getExtras();
initialize(receiveBundle.getString("url"));
}
@SuppressLint("SetJavaScriptEnabled")
private void initialize(String url) {
WebView webView = (WebView) findViewById(R.id.browserView);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.MEDIUM);
webView.getSettings().setDomStorageEnabled(true);
_progressBarLayout = (LinearLayout) findViewById(R.id.browserProgressLayout);
final Activity activity = this;
webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
// Activities and WebViews measure progress with different scales.
// The progress meter will automatically disappear when we reach 100%
activity.setProgress(progress * 1000);
}
});
webView.setWebViewClient(new browserClient());
if (url != null && !"".equals(url))
webView.loadUrl(url);
}
@Override
public void onBackPressed() {
finish();
}
public class browserClient extends WebViewClient
{
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
_progressBarLayout.setVisibility(View.GONE);
}
}
}
닐, 그 대답은 나를 위해 작동하지 않습니다.이 때문에 다시 게시했습니다. –
웹보기를 사용하고 브라우저 응용 프로그램을 실행하는 대신 응용 프로그램 내에서 URL을 시작할 수 있습니다 ... 응용 프로그램이 사용되지 않을 때 알림 표시 줄을 비활성화 할 수 있다고 생각하지 않습니다. –
브라우저가 외부 응용 프로그램입니다. 우리는 다른 응용 프로그램의보기/창을 제어하거나 변경할 수 없습니다. 당신이 원하는 것은 불가능합니다. 이러한 응용 프로그램은 해당 응용 프로그램이 응용 프로그램에서 실행되는 경우에도 테마 또는 설정을 사용하지 않습니다. –