当我在棒棒糖5.1股点击浏览器不显示我的应用程序 [英] my app is not displayed when I click on share on browser in lollipop 5.1

查看:212
本文介绍了当我在棒棒糖5.1股点击浏览器不显示我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图打开我的应用程序,当你点击任何网络链接的份额。我该怎么办呢?我是否需要任何广告的许可?我已经添加下面的code,但我没有看到我的应用程序在共享列表。我怎样才能得到它的工作。我真的AP preciate任何帮助。

清单:

 <?XML版本=1.0编码=UTF-8&GT?;
<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=example.link>    <使用许可权的android:NAME =android.permission.INTERNET对/>    <应用
        机器人:allowBackup =真
        机器人:图标=@的mipmap / ic_launcher
        机器人:标签=@字符串/ APP_NAME
        机器人:主题=@风格/ AppTheme>
        <活动
            机器人:名字=。MainActivity
            机器人:标签=@字符串/ APP_NAME>
            &所述;意图滤光器>
                <作用机器人:名字=android.intent.action.MAIN/>                <类机器人:名字=android.intent.category.LAUNCHER/>                <作用机器人:名字=android.intent.action.VIEW/>
                <类机器人:名字=android.intent.category.DEFAULT/>
                <类机器人:名字=android.intent.category.BROWSABLE/>
                <数据
                    机器人:计划=HTTP机器人:主机=*/>
            &所述; /意图滤光器>
        < /活性GT;
    < /用途>< /清单>

摇篮:

 安卓{
    compileSdkVersion 23
    buildToolsVersion23.0.0    defaultConfig {
        的applicationIDexample.link
        22的minSdkVersion
        targetSdkVersion 23
        版本code 1
        的versionName1.0
    }
    buildTypes {
        发布 {
            minifyEnabled假
            proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
        }
    }
}


解决方案

您必须低于code添加到您要同时打开一个活动上分享preSS

 <意向过滤器的android:标签=您的应用程序名称>
<作用机器人:名字=android.intent.action.SEND/>
<类机器人:名字=android.intent.category.DEFAULT/>
<数据机器人:mime类型=text / plain的/>

I am trying to open my app when you click share on any weblink. How can I do it ? Do I need to ad any permission ? I have added the code below but I dont see my app in the share list. How can I get it to work. I really appreciate any help.

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="example.link" >

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data
                    android:scheme="http" android:host="*" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Gradle:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "example.link"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

解决方案

You have to add below code to an activity which you want to open while press on share

<intent-filter android:label="Your app Name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />

这篇关于当我在棒棒糖5.1股点击浏览器不显示我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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