因此,所有的好,但我想添加这个库 https://github.com/wdullaer/MaterialDateTimePicker本
implementation 'com.wdullaer:materialdatetimepicker:4.0.1'
Run Code Online (Sandbox Code Playgroud)
当我同步我的Graddle时,突然出现了这个错误
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:10:5-53:19 to override.
Run Code Online (Sandbox Code Playgroud)
即使我在清单中添加了该建议
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.itt.ceatm">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:appComponentFactory"> // HERE
<activity...
Run Code Online (Sandbox Code Playgroud)
我无法完成它,因为现在我收到此错误
Manifest merger failed with multiple errors, see logs
Run Code Online (Sandbox Code Playgroud)
这是我的完整清单
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.itt.ceatm"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName …Run Code Online (Sandbox Code Playgroud) 您好,我想知道如何从 NavigationView 更改菜单 ID,在这种情况下,它是在用户单击 RadioButton 时触发的。我已经有了那部分,但我只需要知道如何更改菜单,因此在菜单中,单击 RadioButton 时它将显示不同的选项。
private var radioAdm:RadioButton? = null
private var radioAtle:RadioButton? = null
private var atletanav:BottomNavigationView? = null
private var menuopt = "@menu/admin_menu"
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
// Here is where I need to put that code
}
Run Code Online (Sandbox Code Playgroud)
我已经试过了,但没有成功:
atleta_navbar.set(menu){menu=menuopt}
atleta_navbar.setTag(menuopt)
Run Code Online (Sandbox Code Playgroud)
所以在 NavigationView 它将从这个开始:
对此: