您的位置:首页 > 其它

Could not execute method of the activity

2016-08-03 16:26 274 查看
今天遇到了一个Could not execute method of the activity的方法错误,

最后查阅了百度,

1、是说造成这种因素的原因就是代码的顺序问题,

比如在onCreate方法中@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
username = (EditText) findViewById(R.id.username);
pwd = (EditText) findViewById(R.id.pwd);
}
如果<pre name="code" class="java" style="margin-top: 0px; margin-bottom: 10px; font-size: 13px; line-height: 24.05px; background-color: rgb(255, 255, 255);">setContentView(R.layout.activity_main);
调换了顺序,就会发生这种错误,而我查阅了下,我不是这种错误,
2、我主要是一个控件变量忘记初始化。
导致系统找不到可执行的方法变量,所以发生了<span style="font-size: 13.3333px;">Could not execute method of the activity的方法错误。</span>


<span style="font-family: 'Microsoft YaHei', 微软雅黑, Arial, 'Lucida Grande', Tahoma, sans-serif; font-size: 13px; line-height: 24.05px;"></span>


<span style="font-family: 'Microsoft YaHei', 微软雅黑, Arial, 'Lucida Grande', Tahoma, sans-serif; font-size: 13px; line-height: 24.05px;"></span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Could not execute me
相关文章推荐