Call Activity In Another Package
I've been reading through some of the other posts about calling an activity in another package and it looks like I'm doing it right but still getting this error from my main activi
Solution 1:
It is the same thing which you do in normal scenario but with a little tweak in it. In FirstActivity where ever you want to call other activity from other package, put following code
code
Intenti=newIntent();
i.setClassName("com.CodeArt.finalactivity", "com.CodeArt.finalactivity.FinalActivity");
startActivity(i);
Here com.CodeArt.finalactivity
is the package name and com.CodeArt.finalactivity.FinalActivity
is full class name.
Now go to the AndroidManifest.xml of the FirstActivity and Add following line
activity android:name=”com.CodeArt.finalactivity.FinalActivity
” in application tag.
It will work fine.
Solution 2:
Just an assumption, but have you already add your second project into your current one? Otherwise you cannot reach out its class even though you declare them in your manifest. To know how to achieve that you can check here
Post a Comment for "Call Activity In Another Package"