0

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(); } }

17th May 2017, 5:14 AM
Srinu
Srinu - avatar
4 odpowiedzi
+ 4
in Android studio after compile and run go to the run tab at the bottom of Android studio. you will get all error on red color post the error here or go through the line number mentioned on the error
17th May 2017, 5:43 AM
MR Programmer
MR Programmer - avatar
+ 4
can you send the apk or project here. i will try to debug.
17th May 2017, 6:10 AM
MR Programmer
MR Programmer - avatar
0
actually it's crashing on some mobile phones not in every device
17th May 2017, 5:46 AM
Srinu
Srinu - avatar
0
If it crashes on some mobile phones then: a. check if the mobile phones have the minimum Android that you've put on your programme. b. you have to check the history and find the differences between a mobile phone that works with the one that doesn't.
17th May 2017, 5:54 AM
Elias Papachristos
Elias Papachristos - avatar