-1

I'm new to Android developing. I'm trying to start another activity from MainActivity but it forces close.

Intent myIntent = new Intent(MainActivity.this, SecondActivity.class); startActivity(myIntent);

  • Does this answer your question? [Unfortunately MyApp has stopped. How can I solve this?](https://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this) – Selvin Feb 03 '21 at 17:01

1 Answers1

0

More details of your code and error message needed but I think you've forgotten to add SecondActivity to AndroidManifest.xml:

<activity android:label="@string/app_name" android:name="SecondActivity"/>
Mahmoud Afarideh
  • 306
  • 4
  • 20