vendredi 24 juin 2016

if condition is not working after logout

I am accessing input from text box but after exit my application its not working properly and asking again for input:

btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SharedPreferences sf = getSharedPreferences("user", Context.MODE_PRIVATE);
                final String i = sf.getString("FirstUser", "");
                if (et1.getText().toString().trim().length()>0 && et1.getText().toString().trim().equalsIgnoreCase(i)) {

                    Intent intent = new Intent(getApplicationContext(), WebViewOne.class);
                    startActivity(intent);
                } else {
                    Toast.makeText(getApplicationContext(), "No Registered", Toast.LENGTH_LONG).show();
                }

            }
        });

Aucun commentaire:

Enregistrer un commentaire