zoukankan      html  css  js  c++  java
  • Android上面通过URL来启动本地应用

    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.ingwill.MainActivity"
                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>
                    <action android:name="android.intent.action.VIEW" /><!-- 显示数据 -->
    
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.BROWSABLE" /><!-- 定义成浏览器类型,有URL需要处理时会过滤 -->
    
                    <data android:scheme="ingwill" /><!-- 打开以ingwill协议的URL,这个自己随便定义。 -->
                </intent-filter>
            </activity>
        </application>

    第二个intent-filter配置很重要,可以根据自己的需要单独配置一个activity作为调用界面,这里直接使用启动界面作为调用界面。

    配置完成上面的intent-filter后在浏览器里面打开以ingwill://协议开头的URL时系统会调用本地支持ingwill协议的程序对ingwill://xxxxx URL进行处理。

  • 相关阅读:
    凹透镜
    三角形动点和将军饮马
    数学
    壮壮学习准则
    均值不等式,求极值
    2020年自贡中考数学真题,用的是花钱买的"几何画板",wechat:QZCS12
    90年高考题
    裂项:2005年初中数学竞赛题p32,4
    02-需求来源
    01-产品需求的内涵
  • 原文地址:https://www.cnblogs.com/netcorner/p/4912517.html
Copyright © 2011-2022 走看看