第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

老師,我的代碼一樣為什么taost不打印?

public?class?MainActivity?extends?AppCompatActivity?{
private?Button?button;
????private?EditText?editText1;
????private?EditText?editText2;
????private?CheckBox?checkBox;
????private?Button?bu;
????SharedPreferences?pref;
????SharedPreferences.Editor?editor;
????@Override
????protected?void?onCreate(Bundle?savedInstanceState)?{
????????super.onCreate(savedInstanceState);
????????setContentView(R.layout.activity_main);
????????button=?(Button)?findViewById(R.id.button);
????????editText1=?(EditText)?findViewById(R.id.editText);
????????editText2=?(EditText)?findViewById(R.id.editText2);
????????checkBox=?(CheckBox)?findViewById(R.id.checkBox);
????????bu=?(Button)?findViewById(R.id.button);
????????pref=getSharedPreferences("mypref",MODE_PRIVATE);
????????editor=pref.edit();
????????String?con=pref.getString("username","");
????????if?(con==null){
????????????checkBox.setChecked(false);
????????}
????????else?{checkBox.setChecked(true);}
????????bu.setOnClickListener(new?View.OnClickListener()?{
????????????@Override
????????????public?void?onClick(View?view)?{
????????????????String?user1=editText2.getText().toString().trim();
????????????????String?user=editText1.getText().toString().trim();
????????????????if?("admin".equals(user)&&"1234567".equals(user1)){
????????????????????if?(checkBox.isChecked()){
????????????????????????editor.putString("username",user1);
????????????????????????editor.putString("password",user);
????????????????????????editor.commit();
????????????????????}
????????????????????//Toast.makeText(MainActivity.this,"登陸成功",Toast.LENGTH_LONG);
????????????????????else?{
????????????????????????editor.remove("username");
????????????????????????editor.remove("password");
????????????????????????editor.commit();
????????????????????}
????????????????????Toast.makeText(MainActivity.this,"登陸成功",Toast.LENGTH_LONG).show();
????????????????}
????????????????else?{
????????????????????Toast.makeText(MainActivity.this,"密碼錯(cuò)誤",Toast.LENGTH_SHORT);
????????????????}
????????????}
????????});
????}

????}


正在回答

1 回答

我明白了,我寫反了

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Android攻城獅的第二門課(第3季)
  • 參與學(xué)習(xí)       74895    人
  • 解答問(wèn)題       439    個(gè)

手勢(shì)識(shí)別、數(shù)據(jù)存儲(chǔ)和4大組件,讓你牢牢掌握之前的基礎(chǔ)知識(shí)點(diǎn)

進(jìn)入課程

老師,我的代碼一樣為什么taost不打???

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)