Skip to content Skip to sidebar Skip to footer

Start Activity After Resume

My start activity is a LoginView. If the login was correct i call startActivity(new Intent(LoginView.this, MainView.class)); and finish(). So my App switch to the MainView and if

Solution 1:

  login.setOnClickListener(new View.OnClickListener() 
    {
        public void onClick(View view)
        {
            String name=username.getText().toString();
            SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            SharedPreferences.Editor editor = settings.edit();
            editor.putString("username", name);
            if(name.equals("xxx"))
                {

                    Intent intent=new Intent(currentactivity.this,nextactivity.class);
                    intent.putExtras(bundle);
                    startActivityForResult(intent,0);
                }   
        }
    });

Post a Comment for "Start Activity After Resume"