androidx

How to navigate fragment without adding it into backstack with NavController?

守給你的承諾、 提交于 2021-02-08 12:00:56
问题 NavController has methods navigate which navigate by default with backstack. How to navigate to the fragment without having backstack? Please note that, I am not asking about FragmentTransaction 回答1: If you have a back stack of: A -> B And want to get to a back stack of A -> C You can do a 'replace' operation by popping B off the back stack and adding C. In Navigation, this is done by using app:popUpTo (and optionally app:popUpToInclusive="true" if needed) to the <action> in your XML or by

How to make Up Button go back instead of opening Navigation Drawer

戏子无情 提交于 2021-02-08 09:17:40
问题 I successfully implemented a Navigation Drawer in my app, linking each item of the menu to a fragment. The destination fragment hides the DrawerToggle and displays the up button (i.e. the arrow icon), but for whatever reason, if I click on it, it opens the drawer and I can't go back to the previous fragment. I have to press the back button to do it. How can I change this behaviour? Is it possible to solve this without adding code in every fragment? What I use: Navigation Component One

Failed to retrieve removeGhost method

不羁岁月 提交于 2021-02-07 12:52:25
问题 I'm putting in place the Android Navigation Component in my app. Some transitions work fine, but for this one I have an error. The transition view, from fragment A, stay on the new fragment (B) and hide some elements. Moreover, when I scroll in the fragment, the view don't scroll with it. This is the error I get: W/t.qoqa.ui.debu: Accessing hidden method Landroid/view/GhostView;->removeGhost(Landroid/view/View;)V (greylist-max-p, reflection, denied) I/GhostViewApi21: Failed to retrieve

Try to migrate AndroidX to Android AppCompat

China☆狼群 提交于 2021-02-07 12:42:41
问题 I have errors when migrate from AndroidX to Appcompat. Here is log build: 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.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at

Try to migrate AndroidX to Android AppCompat

最后都变了- 提交于 2021-02-07 12:42:27
问题 I have errors when migrate from AndroidX to Appcompat. Here is log build: 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.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at

Error inflating class androidx.appcompat.widget.FitWindowsFrameLayout after migration to androidx

强颜欢笑 提交于 2021-02-05 05:20:34
问题 I made a migration to AndroidX , then I'm getting an error if I try to run the project into an emulator with API 29 . There is no problem in emulators/real devices with API 28 and previous. java.lang.RuntimeException: Unable to start activity ComponentInfo{ [...]}: android.view.InflateException: Binary XML file line #23 in [...]:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in [...]:layout/abc_screen_simple_overlay_action_mode: Error inflating class androidx.appcompat

Error inflating class androidx.appcompat.widget.FitWindowsFrameLayout after migration to androidx

泪湿孤枕 提交于 2021-02-05 05:20:29
问题 I made a migration to AndroidX , then I'm getting an error if I try to run the project into an emulator with API 29 . There is no problem in emulators/real devices with API 28 and previous. java.lang.RuntimeException: Unable to start activity ComponentInfo{ [...]}: android.view.InflateException: Binary XML file line #23 in [...]:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in [...]:layout/abc_screen_simple_overlay_action_mode: Error inflating class androidx.appcompat

Error inflating class androidx.appcompat.widget.FitWindowsFrameLayout after migration to androidx

扶醉桌前 提交于 2021-02-05 05:20:11
问题 I made a migration to AndroidX , then I'm getting an error if I try to run the project into an emulator with API 29 . There is no problem in emulators/real devices with API 28 and previous. java.lang.RuntimeException: Unable to start activity ComponentInfo{ [...]}: android.view.InflateException: Binary XML file line #23 in [...]:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in [...]:layout/abc_screen_simple_overlay_action_mode: Error inflating class androidx.appcompat

Simple Kotlin Project does not show any UI

瘦欲@ 提交于 2021-02-04 08:40:21
问题 I have a very simple Android Project in Kotlin. Just to dig in Kodein. I can not see the two TextViews in the main_layout? I have used MVP pattern for the only MainActivity I have there.. The app starts without a crash and is show a blank white screen. Any hints? BaseActivity: abstract class BaseActivity<V : BasePresenter.View> : AppCompatActivity(), BasePresenter.View { protected abstract val layoutResourceId : Int protected abstract val presenter : BasePresenter<V> val kodeinMu = LazyKodein

Build error due to conflict between Androidx and Android Support recent version

陌路散爱 提交于 2021-01-29 11:34:56
问题 I am stuck with a build error due to some conflict as defined in the title. Here is my error: 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). Here are my build.grade files: apply plugin: 'com.android.application' apply plugin