静态场view.GONE应以静态的方式进行访问? [英] The static field view.GONE should be accessed in a static way?

查看:151
本文介绍了静态场view.GONE应以静态的方式进行访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个Android应用程序,我有一个不产生任何问题但是警告,当我看到一个警告,我想至少知道是什么原因造成的。该应用程序使用的WebView。

I am building an android app and I have a warning that is not causing any problems however, when I see a warning I like to at least know what is causing it. The app uses webview.

下面是位如果code,它导致了警告。

Here is the bit if code that is causing the warning.

ImageView viewSplash;
WebView mWebView;
@Override
public void onCreate(Bundle icicle) {

    super.onCreate(icicle);
    setContentView(R.layout.main);

    viewSplash = (ImageView) findViewById(R.id.splash);
    mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setGeolocationEnabled(true);
    mWebView.loadUrl("http://www.google.com");
    mWebView.setWebViewClient(new WebViewtest(){
        @Override
        public void onPageFinished(WebView View, String url)
        {
            viewSplash.setVisibility(View.GONE);

                }
    });
}

这是错误:

的静电场View.GONE应以静态的方式进行访问。

The static field View.GONE should be accessed in a static way.

推荐答案

嗯,我可以看到一个问题,这可能是相关的。你有一个大写的视图作为参数名称(请参阅公共无效onPageFinished(web视图 - >查看< - ,字符串URL))。 Uncapitalise这一点。

Well, I can see one problem which might be relevant. You have a capitalised View as an argument name (see public void onPageFinished(WebView -> View <-, String url)). Uncapitalise this.

编辑:问题是争论的名字是错误的帽子,和掩蔽用一个实例变量的访问,这就是为什么你得到了错误的类访问。更好的解决将是理清资本。

the problem was the argument name being the wrong caps, and masking the class access with an instance variable access, which is why you got the error. The better fix would be to sort out the capitalisation.

这篇关于静态场view.GONE应以静态的方式进行访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆