Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从android应用程序通过意图启动网站时如何显示进度条和自定义标题_Android - Fatal编程技术网

从android应用程序通过意图启动网站时如何显示进度条和自定义标题

从android应用程序通过意图启动网站时如何显示进度条和自定义标题,android,Android,我正在开发一个应用程序,该应用程序使用intent打开web浏览器。我想让它显示一个加载。。标题栏,以及显示打开网页的加载状态。在完全加载网页时,我希望应用程序名称显示在标题栏中。我在附近看到了一些东西,但它是用于web视图的。我的案例正在使用意图来启动它,下面是我的代码。谢谢你的帮助 public class WebPageLoader extends Activity { final Activity activity = this; WebView webView; @Override

我正在开发一个应用程序,该应用程序使用intent打开web浏览器。我想让它显示一个加载。。标题栏,以及显示打开网页的加载状态。在完全加载网页时,我希望应用程序名称显示在标题栏中。我在附近看到了一些东西,但它是用于web视图的。我的案例正在使用意图来启动它,下面是我的代码。谢谢你的帮助

public class WebPageLoader extends Activity
{

final Activity activity = this;
WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
  this.setContentView(R.layout.main);
   Uri uri = Uri.parse("http://www.google.com");
  Intent intent = new Intent(Intent.ACTION_VIEW, uri);
  startActivity(intent);

}
}

我不确定你能在Android上实现这一点。处理Intent内置浏览器等的应用程序不会向您报告进度,您也无法设置标题栏。为什么不使用WebView?我正在尝试WebView…但它给了我一个网页不可用的错误..我只能使用上述方法访问网页…您是否允许您的应用程序通过AndroidManifest.xml中的连接到Internet?是。。我做到了…因为我能够使用intent方法访问该站点