我正在努力将PayPal应用到我当前的Android应用程序中,并且我被建议使用Chrome自定义标签,但我似乎无法触发Intent.
我相信我已经在AndroidManifest.xml中正确设置了Intent
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rhiannon.chromecustomtabs">
<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"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CompletePayPalPaymentActivity">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="Test"
android:host="com.Test.TestApp.PayPalReturn"/>
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
我能够在Fragment类中成功启动Google Chrome Tabs(我有2个按钮:
请看下面这段片段的代码:
public class MainFragment extends Fragment implements CustomTabsSceneHelper.ConnectionCallback {
public enum CustomTabsAction {
GOOGLE ("Open Google", "http://google.co.uk"),
REDIRECT ("Open Redirect", "http://{mylocalhost_ip}/~Rhiannon/example1/test.html");
private final String mActionDescription;
private final String …Run Code Online (Sandbox Code Playgroud) android paypal android-intent url-redirection chrome-custom-tabs