我已经实现了applinks来处理我域中的所有url,如下所示
<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.example.com"
android:scheme="http" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
但我想在customtabs中打开来自同一域的一些链接.我正在实现这个逻辑来调用customtabs中的那些链接
CustomTabsServiceConnection connection = new CustomTabsServiceConnection() {
@Override
public void onCustomTabsServiceConnected(ComponentName componentName, CustomTabsClient client) {
client.warmup(0L);
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setInstantAppsEnabled(false);
builder.setToolbarColor(context.getResources().getColor(R.color.pure_white));
builder.setSecondaryToolbarColor(context.getResources().getColor(R.color.pure_white));
builder.setShowTitle(true);
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(context,Uri.parse("http://www.example.com/unhandled"));
}
@Override
public void onServiceDisconnected(ComponentName name) {}
};
CustomTabsClient.bindCustomTabsService(context, "com.android.chrome", connection);
Run Code Online (Sandbox Code Playgroud)
但这些链接是我的applink意图捕获的,它继续循环.我错过了什么?任何想法或建议都会有用.
我在我的项目中使用某些firebase和play服务库.将play services插件版本更新到4.0.0后.由于firebase和play服务现在对每个库使用不同的版本编码策略,因此其中任何一个库中的最高版本代码将替换为所有其他库.这导致无法解析仍在使用较小版本代码的库.
的build.gradle
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
app.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
//apply plugin: 'kotlin-kapt'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig …Run Code Online (Sandbox Code Playgroud) android gradle firebase google-play-services android-gradle-plugin