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.
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.
Please try this way by import second activity class in first activity
Inside onClickListener in First activity
Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivity(intent)
Answered By – gpuser