Reputation: 339
My main package is called com.android.cats
, and I created a another package (in the same app) named com.android.dog
. In package com.android.cats
I created an Activity called Meow.java
, and in package com.android.dog
I created an Activity called Ruff.java
. My question is: how can I switch the activity from Meow.java
to Ruff.java
?
Upvotes: 1
Views: 464
Reputation: 30990
Declare your activities in AndroidManifest.xml
similar to the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.android"
...
>
...
<activity android:name=".cats.Meow" />
<activity android:name=".dogs.Ruff" />
...
Then in your application code, launch your intents as you usually would, of course using the full package name instead (i.e. com.android.dogs.Ruff
)
Upvotes: 1