this을 참조하십시오. 가능하다고 생각하지 않습니다. 사용자가 SharedPreferences에 입력 한 내용을 저장하는 것이 좋습니다.
편집 :
이
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text=""/>
그런 다음 코드에서 당신이들을 수있는 버튼에 리스너를 추가합니다 : 당신이 당신의 레이아웃에 텍스트 뷰를 추가 할 것 문자열 변수를 가져 와서 화면에 표시하려면 이벤트를 클릭하고 클래스의 텍스트 뷰에 대한 참조가 : 클래스
분야 :
TextView tv;
Button myButton;
EditText et;
onCreate():
tv = (TextView)findViewById(R.id.textview);
myButton = (Button)findViewById(R.id.button);
et = (EditText)findViewById(R.id.edittext);
//Now set the onclick listener:
myButton.setOnClickListener(new Button.OnClickListener() {
public void onClick(args....)
{
String txt = et.getText().toString();
tv.setText(txt);
}
});
는 또한체크 아웃을자습서.
음, 알 수 있습니다. 나는 나의 질문을 다시 말해야한다고 생각한다. String 변수를 가져 와서 화면에 표시하는 가장 간단한 방법은 무엇입니까? –
아, 그게 바로 있습니다. 나는 아주 작은 것을 놓치기 위해 스스로를 걷어차주고 싶다. setText (variable)를 제외하고 모든 코드를 제 자리에 가지고있었습니다. 고맙습니다! –