title: Remember me Checkbox in android studio
body: <p>New to Coding and Android Studio.I am trying to set Remember me function in my app but everytime something gets wrong. Here is my code. I tried using sharedpref but did not succeed.somebody help me with this.</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private FirebaseAuth mAuth;
      TextInputLayout Tmail,Tpass;
      ProgressBar Bar;
      CheckBox checkbox;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
          Tmail = findViewById(R.id.login_email);
          Tpass = findViewById(R.id.login_password);
          Bar = findViewById(R.id.bar);
          checkbox = findViewById(R.id.remember);
  
      }
  
      public void signhere(View view) {
          Bar.setVisibility(View.VISIBLE);
          String email = Tmail.getEditText().getText().toString();
          String password = Tpass.getEditText().getText().toString();
          
  
          mAuth = FirebaseAuth.getInstance();
          mAuth.createUserWithEmailAndPassword(email, password)
                  .addOnCompleteListener(MainActivity.this, new OnCompleteListener&lt;AuthResult&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                          if (task.isSuccessful()) {
                              Bar.setVisibility(View.INVISIBLE);
                              Tmail.getEditText().setText(&quot;&quot;);
                              Tpass.getEditText().setText(&quot;&quot;);
                              Toast.makeText(MainActivity.this, &quot;login Succesful&quot;, Toast.LENGTH_SHORT).show();
                              startActivity(new Intent(MainActivity.this,profile.class));
                              finish();
  
                          } else {
                              Bar.setVisibility(View.INVISIBLE);
                              Toast.makeText(MainActivity.this, &quot;Check Email/Password&quot;, Toast.LENGTH_SHORT).show();
  
                          }
                      }
                  });
  
  
      }
  }
  </code></pre>