LeahNH
LeahNH

Reputation: 535

After changing Android starting activity, app doesn't launch

I've built a simple android app, and I'm trying to create a different starting activity. The app ran (with the old starting activity) when my Manifest said:

    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".EnrollActivity"
        android:label="@string/title_activity_enroll" >
    </activity>
    <activity
        android:name=".RecordActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

I've changed the activity section to:

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

Now, when I hit run, nothing launches on my connected device. However, it does add a launch icon entitled EnrollActivity to my device, and if I click that, it works as expected.

How do I get the 'run' button to actually run the app (with the correct name) again?

Upvotes: 3

Views: 2100

Answers (1)

LeahNH
LeahNH

Reputation: 535

I'm using Android Studio, and it turned out I had set my run configurations to launch a specific activity, instead of launching the default activity. Going to Run -> Edit Configurations -> Activity -> Launch Default Activity fixed the problem. Thanks!

Upvotes: 6

Related Questions