android-navigation

is it normal if my image from camera in ImageView disappear after segue to another fragment using navigation component?

非 Y 不嫁゛ 提交于 2021-01-25 01:55:49
问题 I try to capture an image using camera then the image result will be placed on my ImageView in a fragmentA like the code below, so it it NOT fetching an image path from Server then place it in ImageView using Glide Library, I take an image from camera. val image_uri = Uri.fromFile(photoFile) photoImageView.setImageURI(image_uri) and then, I move to next destination using this code (from fragmentA to fragmentB) val toFragmentB = AFragmentDirections.actionGlobalBFragment() findNavController()

is it normal if my image from camera in ImageView disappear after segue to another fragment using navigation component?

空扰寡人 提交于 2021-01-25 01:48:15
问题 I try to capture an image using camera then the image result will be placed on my ImageView in a fragmentA like the code below, so it it NOT fetching an image path from Server then place it in ImageView using Glide Library, I take an image from camera. val image_uri = Uri.fromFile(photoFile) photoImageView.setImageURI(image_uri) and then, I move to next destination using this code (from fragmentA to fragmentB) val toFragmentB = AFragmentDirections.actionGlobalBFragment() findNavController()

is it normal if my image from camera in ImageView disappear after segue to another fragment using navigation component?

拥有回忆 提交于 2021-01-25 01:47:25
问题 I try to capture an image using camera then the image result will be placed on my ImageView in a fragmentA like the code below, so it it NOT fetching an image path from Server then place it in ImageView using Glide Library, I take an image from camera. val image_uri = Uri.fromFile(photoFile) photoImageView.setImageURI(image_uri) and then, I move to next destination using this code (from fragmentA to fragmentB) val toFragmentB = AFragmentDirections.actionGlobalBFragment() findNavController()

is it normal if my image from camera in ImageView disappear after segue to another fragment using navigation component?

若如初见. 提交于 2021-01-25 01:46:46
问题 I try to capture an image using camera then the image result will be placed on my ImageView in a fragmentA like the code below, so it it NOT fetching an image path from Server then place it in ImageView using Glide Library, I take an image from camera. val image_uri = Uri.fromFile(photoFile) photoImageView.setImageURI(image_uri) and then, I move to next destination using this code (from fragmentA to fragmentB) val toFragmentB = AFragmentDirections.actionGlobalBFragment() findNavController()

How to use android navigation without binding to UI in ViewModel (MVVM)?

≯℡__Kan透↙ 提交于 2021-01-20 19:31:57
问题 I am using android navigation that was presented at Google I/O 2018 and it seems like I can use it by binding to some view or by using NavHost to get it from Fragment. But what I need is to navigate to another specific view from ViewModel from my first fragment depending on several conditions. For ViewModel , I extend AndroidViewModel , but I cannot understand how to do next. I cannot cast getApplication to Fragment/Activity and I can't use NavHostFragment . Also I cannot just bind navigation

Properly Scoping ViewModel Across Screens

余生长醉 提交于 2021-01-05 07:20:10
问题 Let's say we have a signup form which span multiple screens such as: So I created a Scoped ViewModel spanning across these screens: The problem is that since the state is scoped across screens, going: PersonalInfo Screen -> Set Username Screen -> (pressed back) Personal Info Screen make it like this: Notice that the username state is retained (since the ViewModel is scoped across the whole flow). So when the user goes back to Set Username Screen instead of a blank state, it retains the

Properly Scoping ViewModel Across Screens

六眼飞鱼酱① 提交于 2021-01-05 07:19:24
问题 Let's say we have a signup form which span multiple screens such as: So I created a Scoped ViewModel spanning across these screens: The problem is that since the state is scoped across screens, going: PersonalInfo Screen -> Set Username Screen -> (pressed back) Personal Info Screen make it like this: Notice that the username state is retained (since the ViewModel is scoped across the whole flow). So when the user goes back to Set Username Screen instead of a blank state, it retains the

Android Navigation Url Deep Link Back to Previous App

为君一笑 提交于 2020-11-25 03:42:48
问题 My app has just two destinations, FirstFragment and SecondFragment . I created an url Deep Link for the SecondFragment and it works fine. What I want is, after I enter the SecondFragment from the Deep Link, I want to go back to the previous app when I press the Back button. But now it always go back to the FirstFragment . I have set my MainActivity to singleTask on launchMode and tried the following but doesn't work: override fun onNewIntent(intent: Intent?) { super.onNewIntent(intent) intent

Android Navigation Url Deep Link Back to Previous App

主宰稳场 提交于 2020-11-25 03:42:17
问题 My app has just two destinations, FirstFragment and SecondFragment . I created an url Deep Link for the SecondFragment and it works fine. What I want is, after I enter the SecondFragment from the Deep Link, I want to go back to the previous app when I press the Back button. But now it always go back to the FirstFragment . I have set my MainActivity to singleTask on launchMode and tried the following but doesn't work: override fun onNewIntent(intent: Intent?) { super.onNewIntent(intent) intent