IBM Worklight - 如何禁用启动画面?

时间:2014-01-21 07:39:19

标签: android ibm-mobilefirst

我正在为我的移动应用项目使用worklight。我的问题是如何在Android清单中禁用启动画面?

这是我的机器人清单。

<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.rmbp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="18" />

    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <!-- Push permissions -->
    <permission
        android:name="com.rmbp.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.rmbp.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:debuggable="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name="com.rmbp.rmbp"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.rmbp.rmbp.NOTIFICATION" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <!-- Preference Activity -->
        <activity
            android:name="com.worklight.common.WLPreferences"
            android:label="Worklight Settings" >
        </activity>
        <!-- Push service -->
        <!--
             In order to use the c2dm library, an application must declare a class with the name C2DMReceiver, in its own package, extending com.google.android.c2dm.C2DMBaseReceiver 
            It must also include this section in the manifest, replacing "com.google.android.apps.chrometophone" with its package name.
        -->
        <service android:name="com.rmbp.GCMIntentService" />
        <service android:name="com.rmbp.ForegroundService" />
        <!-- Only google service can send data messages for the app. If permission is not set - any other app can generate it -->
        <receiver
            android:name="com.google.android.gcm.GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >

            <!-- Receive the actual message -->
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="com.rmbp" />
            </intent-filter>
            <!-- Receive the registration id -->
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.rmbp" />
            </intent-filter>
        </receiver>
    </application>
</manifest>

检查我的回购:https://github.com/datomnurdin/worklight-mobile

提前多多感谢。

1 个答案:

答案 0 :(得分:0)

移动此块:

<intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.rmbp.rmbp.NOTIFICATION" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

到您想先开始的活动。 Intent过滤器会将此活动标记为从启动器启动的默认值。

例如:

<activity
        android:name="com.rmbp.SplashScreen"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/title_activity_splash_screen"
        android:launchMode="singleTask"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="com.rmbp.rmbp"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.rmbp.rmbp.NOTIFICATION" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>