• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Question about different activities in one package

Arehexes

Well-Known Member
Now I got my package set up like this src\com.CollegeTracker
and AddClass.java and CollegeTracker.java and I added AddClass using the Manifest xml. My question is this, when I try to test my code for AddClass CollegeTracker runs instead. How can I get AddClass to run instead of Collegetracker?
 
In your Manifest the applications launch settings are set-up, to launch a specific activity as the first activity of your app, in a sections that looks like this:

Code:
<activity 
  android:name=".MainActivityClass"
  android:label="@string/app_name"
>
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
     </intent-filter>
</activity>

The above code specifies that the MainActivityClass can handle a "LAUNCHER" event, which is how any program is started.

So if you want to test your other activities you either have to chance which class it the main class, or add functionality to go from your main activity to the other, i.e. startActivity();
 
Back
Top Bottom