아래 코드에서 런타임 오류가 발생합니다. 컴파일시이 오류가 표시되지 않는 이유는 무엇입니까? 텍스트를 설정하기 전에안드로이드 텍스트보기에서 런타임 오류가 발생합니다
txt_Currenttime = (TextView)findViewById(R.id.textviewid);
txt_Currenttime.setText(String.valueOf(12));
:
public class AndroidUIActivity extends Activity implements OnClickListener {
private static final int PROGRESS = 0x1;
private ProgressBar mProgress;
private int mProgressStatus = 0;
private int maxtime=0;
private Handler mHandler = new Handler();
int fileSize=0;
private MediaPlayer mp3player;
private TextView txt_Currenttime;
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
txt_Currenttime.setText(12); /* line with error */
}
}
서식있는 질문을 입력하십시오. 댁의 끔찍한 – Riskhan
또한 오류 덤프가 도움이 될 수 있습니다. –
txt_Currenttime을 초기화 했습니까? – magirtopcu