2013-07-10 117 views
-3

我正在创建一个应用程序,listvView包含四个EdiTexts,并且每行都有一个按钮,但是当我编辑editText并单击后退按钮以隐藏键盘,它会删除所有的值! 这有点麻烦,我不能继续发展它! 如果你有任何我想要的想法。 感谢您的时间,祝您有美好的一天。当我点击后退按钮时重新启动应用程序

编辑: 我想,当我点击后退按钮,隐藏键盘没有,清除所有的值,我会加入apk如果你想/需要^^,感谢您的快速回答。 有链接到应用程序:

https://docs.google.com/file/d/0BwyELfc-0SheZlo3cElfSzdERnc/edit?usp=sharing

对不起我的英文不好,后。

+0

你的问题是什么,你想达到什么目的? – Neoh

+0

我想,当我点击后退按钮,隐藏键盘没有,清除所有的值,我会加入apk如果你想/需要^^,感谢您的快速答案。 – Ilisparrow

回答

0

简单的方法是当您按回按钮时存储您的值。一个编辑文本的示例:

String temp1 = ""; 
EditText editText1 = (EditText)findViewById(R.id.editText1); 

Button button = (Button) findViewById(R.id.button1); 
button.setOnClickListener(new View.OnClickListener() { 
    @Override public void onClick(View v) { 
     editText1.setText(temp1); 
    } 
}); 



@Override 
public void onBackPressed() { 
    temp1 = editText1.getText.toString(); 
} 
相关问题