as a second param for intent you should pass desired Activitys class, not package name
e.g. if you would want to open new instance of MainActivity:
new Intent(MainActivity.this, com.example.goaltracker.MainActivity.class);
in fact com.example.goaltracker. prefix isn’t needed, you may just import desired Activity class (new Intent(MainActivity.this, DesiredActivity.class))
2
Answers
as a second param for intent you should pass desired
Activity
s class, not package namee.g. if you would want to open new instance of
MainActivity
:in fact
com.example.goaltracker.
prefix isn’t needed, you may just import desiredActivity
class (new Intent(MainActivity.this, DesiredActivity.class)
)PS. NEVER post code/text as screenshot!!!
Instead of this:
Use this :
And when you create an activity, the preference is to name the first caractere of the word in uppercase, for example :
GoalTracker.class