I’m currently working on a mobile app for our final project this semester. I want to know how to open an activity in a package from another activity from a different package.
Example:
FirstActivity in com.example.package1
SecondActivity in Package2
Package2 is inside in the com.example.package1
I want to open SecondActivity when a button is clicked in FirstActivity.
The underlined class is the 2nd Activity and the highlighted one is the 1st activity.
2
Answers
Please try this way by import second activity class in first activity
Inside onClickListener in First activity
Add activity in your manifest file like this:
In Java file like this: