我正在为用户创建个人资料,但我不知道为什么会收到此错误
请问您能看一下代码并告诉我出什么问题了吗?
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) {
}
};
}
}
答案 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
}
}