标题:求助,我在Button控件上加setOnClickListener程序就闪退
取消只看楼主
the_second
Rank: 2
等 级:论坛游民
帖 子:115
专家分:80
注 册:2015-9-13
结帖率:78.95%
 问题点数:0 回复次数:1 
求助,我在Button控件上加setOnClickListener程序就闪退
package com.example.administrator.pactice_intent;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private Button next;
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        next = (Button) findViewById(R.id.next);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        next.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View view)
            {
            }
        });
    }
}
搜索更多相关主题的帖子: private package public import 
2016-05-19 18:35
the_second
Rank: 2
等 级:论坛游民
帖 子:115
专家分:80
注 册:2015-9-13
得分:0 
next是我的Button键
我一加上
next.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View view)
            {
            }
        });

下载到手机里的程序就闪退
手机用的是Mate8
2016-05-19 18:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-465024-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.559425 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved