我在打开和关闭键时出错

时间:2019-02-02 10:46:16

标签: java android

我正在为用户创建个人资料,但我不知道为什么会收到此错误

请问您能看一下代码并告诉我出什么问题了吗?

public class Profile extends AppCompatActivity {
EditText editText;
ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile2);

        editText =(EditText)findViewById(R.id.nome);
        imageView=(ImageView) findViewById(R.id.foto);


        imageView.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {

            }
    };
}





}

1 个答案:

答案 0 :(得分:0)

尝试一下:

public class Profile extends AppCompatActivity {
EditText editText;
ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile2);

    editText =(EditText)findViewById(R.id.nome);
    imageView=(ImageView) findViewById(R.id.foto);


    imageView.setOnClickListener(new View.OnClickListener(){

        @Override
        public void onClick(View v) {

        }
    }); 
    // the closing parathesis ')' of setOnClickListener was missing
}

}