Can anyone please help regarding my app crash?
I am passing two intents from main activity .There's no problem while passing 1st intent but by going to main activity I'm trying to pass 2nd intent the app crashes.So,how to fix this my code is: public class HomeScreen extends AppCompatActivity{ ImageView show_cat,settings,search;Animation an; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); show_cat=(ImageView)findViewById(R.id.show_cat); settings=(ImageView)findViewById(R.id.setting_show_fragment); } public void showCat(View view){ an=AnimationUtils.loadAnimation(this,R.anim.fade_buttons); show_cat.startAnimation(an); Intent i=new Intent(getApplicationContext(),Categories.class); startActivity(i); } public void showSettings(View view){ an=AnimationUtils.loadAnimation(this,R.anim.fade_buttons); settings.startAnimation(an); Intent i=new Intent(getApplicationContext(),Settings.class); i.putExtra("Code","home"); startActivity(i); finish(); } }