Does <data android:host="www.calender.com" android:scheme="http"></data> make application invisible?
Asked Answered
F

1

5

I have used implicit intents in order to open my application when some one clicks on a URL in other application,I am unable to see the deployed application's icon.After deploying my aplication if i go back and try to find my application i am un able to find it.But it's in the recent app's.This is the code in the android manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mindtree.calender">
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:host="www.calender.com" android:scheme="http"></data>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
Filmer answered 11/11, 2016 at 8:5 Comment(0)
E
7

You have to add a separate intent filter inside your activity tag:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mindtree.calender">
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

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

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:host="www.calender.com" android:scheme="http" />
        </intent-filter>

    </activity>
</application>

Extrasystole answered 11/11, 2016 at 8:22 Comment(1)
i had to place <category android:name="android.intent.category.DEFAULT" /> in the seperated intent filter.. I am so dumb..you saved me.. :) @Rafay AliFilmer

© 2022 - 2024 — McMap. All rights reserved.