Skip to content
Advertisement

Tag: android-fragments

How can I switch between Fragments without destroying and re-creating them? (in a static-like way)

My app uses a BottomNavigationBar to switch between Fragments, and it does it this way: I want those Fragments to be static, so their content and views do not dissapear when I switch between them. I have tried to create them inside MainActivity’s onCreate() method, but it only helps with retaining text inside EditText widgets, the rest of the views

Activity does not have a NavController set on

I basically set up 3 fragments for my bottom navigation view with all linked to activity.xml activity.xml where I put fragment tag. My Activity.java code (specifically): The problem now is that if I run that same java code using fragment tag in xml, it runs well but suggests I use <androidx.fragment.app.FragmentContainerView(linters) but on using <androidx.fragment.app.FragmentContainerView, it displays the error in

Activity or Fragment for a SearchView?

I´m doing my final degree project and I have chose to develop and Android app using Firebase Firestore, the idea it´s cool because I´m learning how to program on Android, but on Java. So, I have develop the SplashScreen, Login form, SignIn form and able to connect succesfully with Firebase but right now I´m having a problem about thinking the

How to prevent activity to restart after changing its orientation

I’m new to android development using KOTLIN, i have activity that contain fragments like the image below (Image 1), the problem is whenever i try to change the orientation from potrait to landscape, the activity return to the previous activity (Like restart it). I’ve tried to add android:configChanges=”orientation|screenSize|keyboardHidden” to my AndroidManifest.xml, it works perfectly but some says that it’s not

Advertisement