Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

android multiple activity declaration in manifest

I have a main activity. From it, I am calling 2 other sub activities called FacebookLogin and Twitterlogin. I am using the following code in AndroidManufest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.examples.Kikin" android:versionCode="1"
android:versionName="1.0">
<!-- THIS IS THE BEGINNING OF SHARING LINKS FROM THE BROWSER -->
<application android:icon="@drawable/kikinlogo"
    android:label="@string/app_name" android:debuggable="true">
    <activity android:name=".Kikin" 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 android:label="@string/app_name">
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>
    <activity android:name=".FacebookLogin" android:label="@string/app_name">
        <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
        <!--    <data android:mimeType="image/png" /> -->
        </intent-filter>
    </activity>
    <activity android:name=".TwitterLogin" android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.VIEW"></action>
            <category android:name="android.intent.category.DEFAULT"></category>
            <category android:name="android.intent.category.BROWSABLE"></category>
            <data android:scheme="yourapp" android:host="twitt"></data>
        </intent-filter>
    </activity>

</application>
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />

Am i doing it right? Should i nest the FacebookLogin and TwitterLogin activities in the main activity? The aforesaid 2 classes are in the package com.examples.. * is the same wherever used.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The labels for your FacebookLogin and TwitterLogin appear to be missing an '@' - change them to android:label="@string/app_name"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...