이것은 간단한 질문이지만 .. 출력이 나오지 않습니다. 설명 : 내 활동에는 3 버튼 A, B, C가 있습니다. 동일한 활동에서 1 textview {textViewPatientType}도 있습니다. 버튼 (A)을 onclick하면 텍스트 뷰 (textViewPatientType)를 A로 설정해야합니다. 버튼 (B)을 onclick하면 텍스트 뷰 (textViewPatientType)로 텍스트를 B로 설정해야합니다.단추 설정 텍스트 onclick 데이터를 텍스트보기로 설정하는 방법
내 활동이 이와 같이 표시됩니다.
-------------------------------------------------
buton1-->onclick A| textview(A)
buton2 |
buton3 |
-------------------------------------------------
나는이 방법으로 수행하려고하지만 건배 역할 .. itcomes 및 disappers가 .. 그래서 PLZ 도와 때 온 클릭 (A) .. 사전에 U 감사드립니다.
여기 내 코드입니다. 텍스트가 그대로있는 경우
button1 = (Button) findViewById(R.id.button1);
button2 = (Button) findViewById(R.id.button2);
button3 = (Button) findViewById(R.id.button3);
textViewPatientType = (TextView) findViewById(R.id.textViewPatientType);
buttonInPatient.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
try {
**textViewPatientType.setText("InPatient");**
ServiceManager.callPatientService(WorkListView.this, "IP", user, pd);
} catch (Exception e) {
e.printStackTrace();
}
Toast.makeText(WorkListView.this, getResources().getString(R.string.inPatient), Toast.LENGTH_SHORT).show();
}
});
시도해 본 문장에 영향을 미치지 않으므로이 .settext ("inpatient")를이 시도에 넣으려고 했습니까? – Darpan