나는 갇혀 있고 다른 것들을 시도했지만, 여전히 빈 몸체 오류를 얻기 위해 내가 코드에서 잘못하고있는 것이 무엇인지 알지 못합니다.경고 - 'if'문에 빈 몸체가 있습니다.
public void eatCookie(View view) {
Button button = (Button) findViewById(R.id.button_Option);
final String buttonText = button.getText().toString();
String eatCookie = "EAT COOKIE";
if (buttonText == eatCookie);{
// TODO: Find a reference to the ImageView in the layout. Change the image.
ImageView imageView = (ImageView) findViewById(R.id.android_cookie_image_view);
imageView.setImageResource(R.drawable.after_cookie);
// TODO: Find a reference to the TextView in the layout. Change the text.
TextView textView = (TextView) findViewById(R.id.status_text_view);
textView.setText("I'm so full");
button.setText("Reset");
}
이 (';') 세미콜론을 제거의 라인'에서 if (buttonText == eatCookie); {' – shash678
다음에 세미콜론을 제거 if (buttonText == eatCookie) –
정말 고마워요 –