Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [android-fragments]

Fragments represent reusable behaviors or portions of the user interface in an Android app.

android-fragments
-1 votes
0 answers
20 views

My Fragment Result Listener won't update the text

I am trying to get my app to display different text each time a button is pressed. The first time I press any button it works fine, but afterwords it reverts my textviews on the fragment to the ...
Allan Sharad's user avatar
0 votes
0 answers
7 views

Is it possible to set the state of a Fragment to stopped without destroying the view using FragmentManager?

For some reason, I would like to just move the state of a fragment to stopped after hiding it, but not to destroy it (or detach from window) transaction.setMaxLifecycle(it, Lifecycle.State.STARTED) ...
Xixiaxixi's user avatar
  • 329
0 votes
0 answers
14 views

Android - NavController - Reopening fragment is maintaining the Accessibility focus

I've two fragments - IntroFragment DetailFragment Intro layout - <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&...
AndroidCoder's user avatar
  • 2,725
0 votes
0 answers
27 views

Android : fragment navigation with parentFragmentManager

I have created from Android studio a new Android ( Kotlin) project based on the �� Bottom Navigation View Activity » template. So, 1 activity with its XML template that contains the navigation part ...
johann's user avatar
  • 1,135
0 votes
0 answers
18 views

how can i display a fragment on a floating window using a button that is on another fragment

i try to go from one fragment to another within the floating window using buttons. I manage the fragments using a activity that contains them but when using the button on the first fragment (...
María's user avatar
  • 11
0 votes
0 answers
22 views

Android Fragments - Return back to same fragment after switching back to initial tab

I am trying to understand the architecture which is being followed by most of the android app nowadays. (example: YouTube, Whatsapp etc) Lets say we have two tabs Tab1 and Tab2 And we have three ...
CruzerBlade's user avatar
0 votes
1 answer
10 views

Problems with the click event in a TableLayout and view pager in android studio

i was working on an app where i was trying to build tab layout and insert fragments in that but in starting it was blinking and after that it was neither being clicked or being Scrolled Problems with ...
Amritpal Singh's user avatar
0 votes
1 answer
19 views

How do I change the behavior and icon of a Floating Action Button between fragments?

I created a Basic Views Activity in Android Studio and I cannot figure for the life of me how to change the "setOnClickListener" and icon of the FAB between fragments. I'm using the FAB to ...
user avatar
0 votes
0 answers
15 views

Best Practice of using Navigation Component. Activities only or only Fragments or Both of them together?

I am working with Navigation in android and multiple questions came up: If an android application only consist of activities, is it good practice to make NavGraph for activities? Or NavGraph should ...
Dnveeraj's user avatar
  • 117
0 votes
0 answers
18 views

Initialise SavedStateHandle in shared view model

I have a parent fragment and a child fragment which have a shared viewmodel. The viewmodel uses the SavedStateHandle to retain viewmodel state even after process kill. The parent fragment uses shared ...
Tushar Singhal's user avatar
0 votes
1 answer
24 views

How to instantiate fragment views in Android?

In a detail layout, I added a tab layout with multiple tab items using fragments. <com.google.android.material.tabs.TabLayout android:id="@+id/tabLayout" android:...
Hussain Akbar's user avatar
0 votes
0 answers
9 views

How to navigate to fragment C from a fragment B in viewpager which is present in fragment A using Navigation Component?

I tried adding the actions in each viewpager fragments, but on click of the button in Viewpager Fragment. The app crashes and displays the following error: FATAL EXCEPTION: main Process: com....
crazydose's user avatar
0 votes
0 answers
18 views

Android application fragments showing content only when theme (light/mode) is switched

I am working on an android application and I spent a long time implementing a NavController with my BottomNavigationView. It works properly, I can transition between the different buttons but the ...
Matthias Sunbreeze's user avatar
0 votes
0 answers
18 views

How do I initialize a TableLayout in Kotlin?

I have another fragment that I want to launch to when clicking a button and in that fragment I want to add stuff to a table. The only problem is, I try to initialize a TableLayout variable but it's ...
JosephFC97's user avatar
0 votes
0 answers
51 views

How to Enable Edge-to-Edge Display Only for Specific Fragment in Android with Bottom Navigation?

I'm working on an Android app with an activity that contains a bottom navigation bar and three fragments. I want my HomeFragment to have an edge-to-edge display, but when I enable edge-to-edge mode in ...
Md. Rahadul Islam Rahad's user avatar

15 30 50 per page
1
2 3 4 5
3047