androidx

AndroidX migration - data binding error msg:Cannot find the setter for attribute 'android:visibility' with parameter type int

醉酒当歌 提交于 2021-02-20 04:42:45
问题 I'm migrating a project to AndroidX and have the following error : Caused by: java.lang.RuntimeException: android.databinding.tool.util.LoggedErrorException: Found data binding errors. ****/ data binding error ****msg:Cannot find the setter for attribute 'android:visibility' with parameter type int on androidx.constraintlayout.ConstraintLayout And the layout having the issue is : <androidx.constraintlayout.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap

How to change toolbar back button icon in android material components

坚强是说给别人听的谎言 提交于 2021-02-19 05:11:51
问题 I would like to change the default navigate up icon (back button icon) to my custom icon. I not using a drawer, just a simple toolbar and material components Is this possible? 回答1: If you are using a Toolbar to change the icon just use: Toolbar toolbar = findViewById(R.id.xxx); toolbar.setNavigationIcon(R.drawable.xxxx4); setSupportActionBar(toolbar); If you are using the ActionBar you can use: getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator(R

How to change toolbar back button icon in android material components

被刻印的时光 ゝ 提交于 2021-02-19 05:10:07
问题 I would like to change the default navigate up icon (back button icon) to my custom icon. I not using a drawer, just a simple toolbar and material components Is this possible? 回答1: If you are using a Toolbar to change the icon just use: Toolbar toolbar = findViewById(R.id.xxx); toolbar.setNavigationIcon(R.drawable.xxxx4); setSupportActionBar(toolbar); If you are using the ActionBar you can use: getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator(R

Cannot access 'androidx.activity.result.ActivityResultCaller'

一曲冷凌霜 提交于 2021-02-18 22:39:49
问题 I'm using androidx for quite a while and my Android project compiles fine, however recently my Android Studio throws tons of red for all Activity classes because of cannot access 'androidx.activity.result.ActivityResultCaller' which is a supertype of ... I use AppCompatActivity from androidx.appcompat:appcompat:1.1.0 My build.gradle has: ext.kotlin_version = '1.3.71' ... dependencies { classpath 'com.android.tools.build:gradle:3.6.3' classpath 'com.google.gms:google-services:4.3.3' And gradle

Cannot access 'androidx.activity.result.ActivityResultCaller'

巧了我就是萌 提交于 2021-02-18 22:39:44
问题 I'm using androidx for quite a while and my Android project compiles fine, however recently my Android Studio throws tons of red for all Activity classes because of cannot access 'androidx.activity.result.ActivityResultCaller' which is a supertype of ... I use AppCompatActivity from androidx.appcompat:appcompat:1.1.0 My build.gradle has: ext.kotlin_version = '1.3.71' ... dependencies { classpath 'com.android.tools.build:gradle:3.6.3' classpath 'com.google.gms:google-services:4.3.3' And gradle

Kotlin cannot create an instance of ViewModel

假如想象 提交于 2021-02-11 04:32:57
问题 I've been getting the following error against my ViewModel: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.cryptpass_kt.EntryViewModel at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928) at android.app.ActivityThread.-wrap11(Unknown

Kotlin cannot create an instance of ViewModel

穿精又带淫゛_ 提交于 2021-02-11 04:28:59
问题 I've been getting the following error against my ViewModel: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.cryptpass_kt.EntryViewModel at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928) at android.app.ActivityThread.-wrap11(Unknown

Kotlin cannot create an instance of ViewModel

二次信任 提交于 2021-02-11 04:28:20
问题 I've been getting the following error against my ViewModel: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.cryptpass_kt.EntryViewModel at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928) at android.app.ActivityThread.-wrap11(Unknown

LocalBroadcastManager not found in androidx.appcompat:appcompat:1.1.0 but available in 1.0.0

落爺英雄遲暮 提交于 2021-02-11 04:22:35
问题 I just migrated to androidx via the option Refactor -> Move to Androidx option in Android Studio. By default the build.gradle file was using: implementation 'androidx.appcompat:appcompat:1.0.0' I am using LocalBroadcastManager in many places in the project. I could perfectly use import androidx.localbroadcastmanager.content.LocalBroadcastManager with the above v1.0.0 of the androidx.appcompat . But when I update it to 1.1.0 as: implementation 'androidx.appcompat:appcompat:1.1.0' The import is

LocalBroadcastManager not found in androidx.appcompat:appcompat:1.1.0 but available in 1.0.0

余生颓废 提交于 2021-02-11 04:22:35
问题 I just migrated to androidx via the option Refactor -> Move to Androidx option in Android Studio. By default the build.gradle file was using: implementation 'androidx.appcompat:appcompat:1.0.0' I am using LocalBroadcastManager in many places in the project. I could perfectly use import androidx.localbroadcastmanager.content.LocalBroadcastManager with the above v1.0.0 of the androidx.appcompat . But when I update it to 1.1.0 as: implementation 'androidx.appcompat:appcompat:1.1.0' The import is