EDITTEXT返回回previously输入数据后,pressed后退按钮 [英] EditText return back previously input data after pressed back button

查看:115
本文介绍了EDITTEXT返回回previously输入数据后,pressed后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序的登录系统类型的应用程序。
一旦用户$ P $登录后pssed后退按钮,用户名和密码的EditText都充满了哪些用户刚才输入。有什么办法来清除的EditText空?对不起,如果我让这听起来令人困惑。任何评论将被AP preciated!

I have an application login system type of application. Once the user pressed back button after login, the username and password EditText are filled with what the user enter just now. Is there any way to clear the EditText to empty? Sorry that if I make this sounds confusing. Any comment will be appreciated!

推荐答案

您可以通过重写做到这一点的onPause 中的onPause方法活动和方法清除所有的EditText值:

you can do this by overriding onPause method of Activity and in onPause method clear all EditText Value as:

@Override
 protected void onPause(){
        super.onPause();

         // Clear all value here
        editTextone.setText("");
        editTexttwo.setText("");
    }

这篇关于EDITTEXT返回回previously输入数据后,pressed后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆