android-getDrawable上的错误

android-getDrawable上的错误,第1张

概述privateintServiceLeft;privateintServiceRight;privateintServices;finalTextViewcountTextViewPlusL=(TextView)findViewById(R.id.TextViewCountL);finalButtonServiceButtonLeft=(Button)findViewById(R.id.ButtonServiceLeft);finalTextViewcoun

private int Service@R_404_6823@;private int ServiceRight;private int Services;final TextVIEw countTextVIEwPlusL = (TextVIEw) findVIEwByID(R.ID.TextVIEwCountL);final button Servicebutton@R_404_6823@ = (button) findVIEwByID(R.ID.buttonService@R_404_6823@);final TextVIEw countTextVIEwPlusR = (TextVIEw) findVIEwByID(R.ID.TextVIEwCountR);final button ServicebuttonRight = (button) findVIEwByID(R.ID.buttonServiceRight);VIEw.OnClickListener Listner = new VIEw.OnClickListener() {    public voID onClick(VIEw v) {        switch(v.getID()) {           case R.ID.buttonServiceRight:                ServiceRight++;                break;           case R.ID.buttonService@R_404_6823@:                Service@R_404_6823@++;                break;        }        if(Services % 2 == 0) {            getDrawable(R.drawable.test);        }    }};

我收到“ getDrawable”错误@H_404_6@

@H_404_6@

getDrawable(R.drawable.test);

它说:对于新的VIEw.OnClickListener(){}类型,未定义方法getDrawable(int).@H_404_6@

如何解决呢?@H_404_6@@H_404_6@

解决方法:@H_404_6@

尝试这个 :@H_404_6@

@H_404_6@

MyActivity.this.getResources().getDrawable(R.ID.test);
总结

以上是内存溢出为你收集整理的android-getDrawable上的错误全部内容,希望文章能够帮你解决android-getDrawable上的错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1083377.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存