Category "android-fragments"

Trying to save Night Mode State using Fragment

I am trying to enable Dark Night Mode in my App which is working though but when I restart the app it goes to again Light Mode basically I want to save Dark Nig

NullPointerException on FragmentHostCallback.getContext()

I'm facing this random crash while navigating to a Fragment via deep-link which is declared in the navigation graph file. I'm using navigation component library

When Onclick operates in fragment xml, app crashes

I'm new to the development scene and I'm just trying my hand at fragments. I have an onClick event defined in one of my fragment XML files, but when I click the

Navigation Error: action/destination cannot be found from the current destination

I am using Navigation component to navigate between two Fragments. The landing fragment has a recycler view and the detail fragment has a view pager. I am using

android navigation component: Show view above current showing fragment when app come from background

I working on android app with navigation component, I want to show a pass-code view when app return from background, I don't know the best way to achieve that,

Issue with backstack and bottomnav in kotlin

I have a bottom nav with 4 fragments Home, Following, Notification, and Profile, there is no issue with the bottom navigation on backstack , but now for eg from

Launching Fragment with Espresso displays layout with black overlay and grey actionbar

I wrote a simple espresso test in which I launch a fragment with the following code: package com.example.fragmentedittexttest2 import android.util.Log import a

How to save fragment state while navigating with navigation component

I'm trying to create a single activity app using android architecture components. I have a fragment A which has some textfields, when user pushes a button I nav

Android Navigation Component : Pass value (arguments) in fragments

What I have done: I have created Navigation Drawer Activity, As updated new format of Navigation Drawer Activity, As per new Android architecture, I got it with

How to go from one fragment to another fragment in kotlin?

I have a button in fragment A and when I click on fragment A, I want it to be redirected to fragment B. How to achieve this in kotlin? Right now I am using this

Clicking on item of Navigation Drawer doesn’t open fragments

I want to use the default Navigation Drawer Activity of Android Studio (v. 3.5). After creating this default activity (New Project --> Navigation Drawer Acti

After sending data from MainActivity to Fragment, the variables are setup to 0.0

I'm trying to pass from MainActivity to Fragments (by using ViewPager, and TabLayout, if it will help you anyhow) user's latitude, and longitude. The thing is,

Last navigation gets resubmitted

Okay, so I'm not sure, what exactly triggers that. But I have a suspicion. Sadly it will get hard to make a MWE, since it is a very complex app with lots of fra

Can I change topLevelDestinationIds from AppBarConfiguration?

I have CountriesFragment and this fragment is launching first (start destination) I hid the back button using this code NavigationUI.setupWithNavController(mate

How to resolve the error "LifecycleOwners must call register before they are STARTED"

I am using registerForActivityResult for google sign in implementation in my development. Everything was working fine until I upgraded my fragment dependency t

Currently doing the fragments and navigation pathway of the android kotlin course and having some troubles with the letter list fragment

When I populate the nav_graph.xml with the two fragments the words fragment displays fine but the letters fragment just displays a default item list of 1 to 9.

Should I turn my Activities into Fragments?

I went to the YouTube Academy for Kotlin Android Development and created a semi complex app with Google FireBase, I have hit a roadblock in some code using an E

How to prevent bottom sheet from animating corner shape to square?

I've designed my bottom sheet like this <style name="ShapeAppearanceOverlay.BottomSheet" parent=""> <item name="cornerSize">30dp</item>

Android Programming - Navigation Drawer Multiple Instances of Same Fragment

I am trying to make a weather app where each location that the user adds, it will be shown in the Navigation Drawer. I would like to have multiple items in the

How to clear navigation Stack after navigating to another fragment in Android

I am using The new Navigation Architecture Component in android and I am stuck in clearing the navigation stack after moving to a new fragment. Example: I am