Changing Launcher Activity

#1

Hey guys,

I,ve done all the implementation of chapter 9 and got everything working and understood all the code (after many hours reading and checking) but one thing is not working on my app: Can´t change the Launcher activity to CrimeListActivity. Here is my code of the Manifest:

[code]

<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity android:name=".CrimeListActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity android:name=".CrimeActivity"
        android:label="CrimeDetail">
    </activity>
</application>

[/code]

I started another project with 2 activities to do some tests and this statements worked there. Do you notice anything wrong?

#2

Check your run configuration. Android Studio may be set up to run a specific activity rather than the default activity.

In the “app” dropdown, select “Edit Configurations…”:

Then check the launch activity setting in your run config.

Does that fix the problem?

#3

[quote=“cstewart”]Check your run configuration. Android Studio may be set up to run a specific activity rather than the default activity.

In the “app” dropdown, select “Edit Configurations…”:

Then check the launch activity setting in your run config.

Does that fix the problem?[/quote]

Nop! I fixed replacing the code for this one: https://www.bignerdranch.com/we-write/android-programming/ you made available. But, before that I checked it entirely and didn’t found any bug on mine.
Thank you, anyway.

#4

In abstract SingleFragmentActivity
change from Fragment = new CrimeFragment();
to Fragment = createFragment();

#5

I’ve done the same thing. My code still launches with Crime Activity. This is my second go around with this project.