清单中的android多个活动的声明 [英] android multiple activity declaration in manifest

查看:171
本文介绍了清单中的android多个活动的声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个主要活动。从中,我打电话叫2和FacebookLogin其他Twitterlogin子活动。我现在用的是下面的code在AndroidManufest.xml:

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" />

我做对吗? 我应该窝在主要的 活动FacebookLogin和TwitterLogin活动? 上述2类是在包com.examples。 * 是一样的地方使用。

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.

推荐答案

出现的FacebookLogin和TwitterLogin的标签缺少一个@ - 改变他们的Andr​​oid版本:标签=@字符串/ APP_NAME

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

这篇关于清单中的android多个活动的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆