简体   繁体   中英

Can't launch app with ParseLoginActivity

This is from my AndroidManifest.xml

    <activity
        android:name="com.parse.ui.ParseLoginActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop" >
        <meta-data
            android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_ENABLED"
            android:value="true" />
        <meta-data
            android:name="com.parse.ui.ParseLoginActivity.FACEBOOK_LOGIN_ENABLED"
            android:value="true" />
        <meta-data
            android:name="com.parse.ui.ParseLoginActivity.TWITTER_LOGIN_ENABLED"
            android:value="true" />
    </activity>

This is the main activity that the app launches into:

    <activity
        android:name="com.elgami.feed.FeedActivity"
        android:configChanges="keyboardHidden|orientation|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>
    </activity>

The problem I'm having is that when a fresh user downloads the app they are launched directly into the FeedActivity but they aren't a user and everything is bugged out. They shouldn't be at the FeedActivity until after they've logged in or registered.

It also says "Element intent-filter is not allowed here" when I try to place this into the GlobalApplication. When I try to put it exclusively in the ParseLoginActivity it opens correctly to ParseLoginActivity but now it won't launch into FeedActivity, the screen minimizes and I get this:

11-25 14:20:14.677    1098-1144/com.test.app E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0x9de46060

This is my DispatchActivity:

public class DispatchActivity extends ParseLoginDispatchActivity {

    @Override
    protected Class<?> getTargetClass() {
        return FeedActivity.class;
    }


}

Okay this was dumb of me. I needed to make sure that the app launched to DispatchActivity only and nowhere else:

    <activity
        android:name=".DispatchActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

My DispatchActivity must launch to the Activity I want the user to see once login/registration is complete:

public class DispatchActivity extends ParseLoginDispatchActivity {

    @Override
    protected Class<?> getTargetClass() {
        return FeedActivity.class;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM