2
votes

i want to change my launching activity.for the moment my manifest is this:

<application android:icon="@drawable/iconbj" android:label="@string/app_name"
    android:debuggable="true">
    <activity android:name=".Main" android:label="@string/app_name" android:screenOrientation="landscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:label="DemoPlayActivity" android:name="DemoPlayActivity" android:screenOrientation="landscape"></activity>

</application>

now I have created another activity which is a splash screen and i want to launch this instead of Main so I tried this way:

<application android:icon="@drawable/iconbj" android:label="@string/app_name"
    android:debuggable="true">
    <activity android:name=".Splash" android:label="@string/app_name"
        android:screenOrientation="landscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="Main" android:label="Main"
        android:screenOrientation="landscape">
    </activity>
    <activity android:label="DemoPlayActivity" android:name="DemoPlayActivity"
        android:screenOrientation="landscape"></activity>

</application>

but i get thisproblem with permission:

[2011-03-31 16:32:44 - BlackJackNuovo] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.phinet.android.blackjack/.Main } from null (pid=-1, uid=-1) requires null.

please help me :)

Update

NO WAY. I did this way:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.phinet.android.blackjack" android:versionCode="1"
    android:versionName="1.0">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <application android:icon="@drawable/iconbj" android:label="@string/app_name"
        android:debuggable="true">
        <activity android:name="com.phinet.android.blackjack.Splash" android:label="Splash"
            android:screenOrientation="landscape">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.phinet.android.blackjack.Main" android:label="Main"
            android:screenOrientation="landscape">
        </activity>
        <activity android:label="com.phinet.android.blackjack.DemoPlayActivity" android:name="DemoPlayActivity"
            android:screenOrientation="landscape"></activity>

    </application>
</manifest>

but it seems to lunch always the Main activity,this is the concole log:

[2011-04-01 10:57:10 - BlackJackNuovo] Uploading BlackJackNuovo.apk onto device '9000d365e767'
[2011-04-01 10:57:16 - BlackJackNuovo] Installing BlackJackNuovo.apk...
[2011-04-01 10:57:32 - BlackJackNuovo] Success!
[2011-04-01 10:57:32 - BlackJackNuovo] Starting activity com.phinet.android.blackjack.Main on device 9000d365e767
[2011-04-01 10:57:32 - BlackJackNuovo] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.phinet.android.blackjack/.Main }
[2011-04-01 10:57:35 - BlackJackNuovo] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.phinet.android.blackjack/.Main } from null (pid=-1, uid=-1) requires null

WHY?

1
Tried completly uninstalling the app from emulator Menu > settings > apps > uninstall . Then running again?Blundell
Please just edit your question if you need to provide more information, or the comment facility under individual answers.Tim Post♦

1 Answers

1
votes
<activity android:name="Main" android:label="Main"
    android:screenOrientation="landscape">
</activity>
<activity android:label="DemoPlayActivity" android:name="DemoPlayActivity"
    android:screenOrientation="landscape"></activity>

Should still have the leading .

<activity android:name=".Main" android:label="Main" android:screenOrientation="landscape">
</activity>
<activity android:label=".DemoPlayActivity" android:name="DemoPlayActivity"android:screenOrientation="landscape">
</activity>

This is stating it has a relative path to your Classes. You could make absolute references if you wished, i.e. "com.your.app.Main"