0

I do not know if this bug is in the code that I use to open the activity, or if it lies in the activity itself. This is the code for opening the activity, please tell me if I have an error in this, or if it is something else.

public void openGallery(View view){
    Intent intent = new Intent(this, PhotoGallery.class);
    startActivity(intent);
}
Ayden
  • 37
  • 6
  • 1
    You must post the crash log for anyone to give you any sort of meaningful help on this. Also it would be helpful to post the code from the `onCreate()` of your `PhotoGallery` Activity, as the issue is likely being generated from within that code. – NoChinDeluxe Mar 15 '16 at 20:24
  • Code looks fine. Show your logcat of the crash. Maybe : Intent intent = new Intent(CurrentActivity.this, PhotoGallery.class); will do the trick. And why are you passing a View as Parameter and not using it? – A Honey Bustard Mar 15 '16 at 20:25
  • Please post the crash logs and the "PhotoGallery" code . – Shadab Ansari Mar 15 '16 at 20:26
  • Specifically that activity, or does any activity cause it? Does multi-tasking out of your app and back in again cause a crash? – Columbo Mar 15 '16 at 20:30
  • What does the LogCat say when it opens the activity? – Si8 Mar 15 '16 at 20:46
  • Two things that can be wrong here: 1) PhotoGallery is not an Activity class 2) PhotoGallery activity is not added to AndroidManifest.xml – arsent Mar 16 '16 at 02:48

0 Answers0