相关疑难解决方法(0)

从浏览器启动Android应用程序

我查看了几个与我相似的Stack Overflow问题.每一个都得到回答,原作者似乎很满意,但当我试图复制他们的结果时,我空手而归.显然我正在做一些可怕的错误,但我似乎无法弄明白.

作为参考,这些是我一直在关注的问题:

最终,我希望在用户执行OAuth身份验证请求后使用此功能重新启动我的应用程序.但是,我的实际应用程序有点太大了,无法在此发布.对于这个问题,我已经整理了一个简单的应用程序,向您展示我已经完成的工作.我有两个活动.这主要是因为我见过的每个例子都使用VIEW动作来进行活动.我更喜欢使用MAIN操作,但我在这里使用两者来表明我尝试了两种方法.

AndroidManifest.xml(原文;见下面的编辑版)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.example" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
    <activity android:name=".HelloAndroidActivity">
        <intent-filter>
            <data android:scheme="ex1"/>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity android:name=".CallbackActivity">
        <intent-filter>
            <data android:scheme="ex2"/>
            <action android:name="android.intent.action.VIEW"/>
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

AndroidManifest.xml(编辑以回复评论)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.example" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
    <activity android:name=".HelloAndroidActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity android:name=".CallbackActivity">
        <intent-filter>
            <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.this-so-does-not-exist.com" android:scheme="http" />
        </intent-filter> …
Run Code Online (Sandbox Code Playgroud)

android android-intent

5
推荐指数
1
解决办法
2万
查看次数

我可以从android webview打开whatsapp应用程序吗

我做了一个网站的网络视图。现在我想将我的网络视图中的一些数据共享到 whatsapp 应用程序。我能够打开 whatsapp web,但我的客户希望我打开 whatsapp 应用程序而不是 whatsapp web。我怎样才能做到这一点?

这是我在我的网站中打开 whatsapp 网站所做的工作:

<a class="social-icon whatsapp" 
  href="javascript:popWin('https://api.whatsapp.com/send?text=Product%20Name:-<?php echo $productName; ?>.%20Product%20link:-<?php echo $productUrl; ?>', 'whatsapp', 'width=640, height=480, left=0, top=0, location=no, status=yes, scrollbars=yes, resizable=yes');"
  title="<?php echo $this->__('Share on Whatsapp') ?>" 
  data-action="share/whatsapp/share">
  <span><i class="fa fa-whatsapp"></i></span>
</a>
Run Code Online (Sandbox Code Playgroud)

php android webview

5
推荐指数
4
解决办法
7957
查看次数

标签 统计

android ×2

android-intent ×1

php ×1

webview ×1