Android declaration of several actions in the manifest

I have a main activity. From this, I invoke 2 other helper actions called FacebookLogin and Twitterlogin. I use 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 log into FacebookLogin and TwitterLogin actions basically? The above 2 classes are in the com.examples package.. * - This is the same as for use.

+3
source share
5 answers

There is no such thing as subactivity. Just because you call one action another, it does not mean subactivity.

, , , , .

+1

FacebookLogin TwitterLogin, , "@" - android: label = "@string/app_name"

+1

.

" AndroidManifest.xml?", Activity, , , <activity android:name>, .

, , .

0

Do not insert activity announcements, just use them as elements in your application:

<manifest ...
  <application ...
    <activity ...
    </activity>
    <activity ...
    </activity>
    <activity ...
    </activity>
  </application>
</manifest>

The pattern you posted here (indented) looks great.

0
source

You may have already tested it, but just try to declare your actions the full way (although you already declared it in the package tag). So instead of using

<activity android:name=".TwitterLogin"  />

using

<activity android:name="com.examples.Kikin.TwitterLogin" />

Sometimes this causes problems.

I know this is an old thread, but I m having the same problem and in my case specifying full package name doesnt help. Have you found a solution? I am very interested to know how to avoid this error.

0
source

Source: https://habr.com/ru/post/1785538/


All Articles