android-fragments

Z-Index conflict when animating fragment transition using the Android Navigation component

允我心安 提交于 2021-02-07 03:44:27
问题 I'm trying to use Android Navigation instead of fragment transaction. There is one problem however which is starting to be cumbersome. Upon using a slide-in animation for the Enter Animation the new fragment goes beneath the current fragment. Be sure to check the following video to see the bug in action. https://youtu.be/gFnXiEyiypM The bug seems not to be from the Navigation component though the hacky solutions (this and this) which have been introduced for this specific problem doesn't seem

Z-Index conflict when animating fragment transition using the Android Navigation component

二次信任 提交于 2021-02-07 03:42:38
问题 I'm trying to use Android Navigation instead of fragment transaction. There is one problem however which is starting to be cumbersome. Upon using a slide-in animation for the Enter Animation the new fragment goes beneath the current fragment. Be sure to check the following video to see the bug in action. https://youtu.be/gFnXiEyiypM The bug seems not to be from the Navigation component though the hacky solutions (this and this) which have been introduced for this specific problem doesn't seem

Android memory management granularity - Activity or Process?

最后都变了- 提交于 2021-02-07 02:47:52
问题 I am seeing inconsistent documentation and discussion regarding what happens when Android is low on memory and the steps the OS takes to re-claim memory. More specifically, does Android kill at the granularity of activity/fragment, or entire process? For example, if Activity B is launched in front of Activity A (and both activities are part of the same app/process), can Activity A be killed by the OS while Activity B is in the foreground and the user is interacting with Activity B (assume:

Android memory management granularity - Activity or Process?

你离开我真会死。 提交于 2021-02-07 02:47:44
问题 I am seeing inconsistent documentation and discussion regarding what happens when Android is low on memory and the steps the OS takes to re-claim memory. More specifically, does Android kill at the granularity of activity/fragment, or entire process? For example, if Activity B is launched in front of Activity A (and both activities are part of the same app/process), can Activity A be killed by the OS while Activity B is in the foreground and the user is interacting with Activity B (assume:

How to handle multiple NavHosts/NavControllers?

无人久伴 提交于 2021-02-06 09:31:50
问题 I'm having a problem when dealing with multiple NavHosts. This issue is very similar to the one asked here. I think the solution for this question would help me as well, but it's a post from 2017 and it still has no answer. Android Developers Documentation doesn't help and searching through the web shows absolutely nothing that could possibly help. So basically I have one Activity and two Fragments. Let's call them FruitsActivity, FruitListFragment, FruitDetailFragment, where FruitsActivity

how to start Zxing on a Fragment?

孤街浪徒 提交于 2021-02-06 09:28:08
问题 i have an activity that holds Two Fragments, i want to run ZXING scanner on one of the fragments, currently i do this on another activity like this > new IntentIntegrator(this).initiateScan(); // opens up Scan intent > ZXING how do i do that line but to open up the scan on a fragment ? Also i get the ZXING results on a reciever like this > //results when activity enters a callback sent out to another activity public void onActivityResult(int requestCode, int resultCode, Intent intent) { how

Android Set Text of TextView in Fragment that is in FragmentPagerAdapter

房东的猫 提交于 2021-02-06 04:21:16
问题 This one is driving me nuts. Basically, I want to create a ViewPager and add a few Fragment s to it. Then, all I want to do, it set a value in one of the Fragment 's TextView s. I can add the Fragment s fine, and they attach, but when I go to findViewById() for one of the TextView s in the first Fragment it throws a NullPointerException . I, for the life of me, can't figure out why. Here's my code so far, let me know if more is needed please. public class SheetActivity extends

AutocompleteSearchFragment in Dialog gives InflateException

喜夏-厌秋 提交于 2021-02-05 11:52:36
问题 I am using the Google Map's Places API's AutoCompleteSearchFragment in a Dialog . The error that I am getting occurs when I launch the dialog, close it, then relaunch it. Error Message: Error inflating class fragment. Caused by: java.lang.IllegalArgumentException: Binary XML file line #69: Duplicate id 0x7f0a0027, tag null, or parent id 0x7f0a00c7 with another fragment for `com.google.android.libraries.places.widget.AutocompleteSearchFragmet My code: Dialog alert = new Dialog(MainActivity

How to create a custom fragment that extends NavHostFragment with it's own back stack?

ⅰ亾dé卋堺 提交于 2021-02-05 09:13:25
问题 I'm looking for a generic way to create my custom fragment with that has OnBackPressedCallback and viewModel that extends NavHostFragment using navigation graph i intend to put as child fragments into it's back stack. Normally i create NavHostFragment for each tab or fragment with their FragmentContainerView , it's easy but repetitive to create for each host with fragment_nav_host_home.xml <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android

How to create a custom fragment that extends NavHostFragment with it's own back stack?

吃可爱长大的小学妹 提交于 2021-02-05 09:02:19
问题 I'm looking for a generic way to create my custom fragment with that has OnBackPressedCallback and viewModel that extends NavHostFragment using navigation graph i intend to put as child fragments into it's back stack. Normally i create NavHostFragment for each tab or fragment with their FragmentContainerView , it's easy but repetitive to create for each host with fragment_nav_host_home.xml <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android