이 안드로이드 코드가 있습니다. xml 파일에 정의 된 버튼에 대한 레이아웃이 있습니다 .i 여기에서 버튼에 텍스트를 설정하고 싶습니다. 그러나 앱에서 강제로 가져 오는 것으로 나타납니다. closes.whats가 잘못 되었습니까?android app force closes
package com.action ;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
public class ActionActivity extends Activity {
@Override
public void onCreate(Bundle i){
super.onCreate(i);
Button button=(Button) findViewById(R.id.but);
button.setText("Hey!!");
setContentView(R.layout.main);
}
}
Thnx ...
logcat의 출력도 게시하십시오. – richardwiden