I want to make an application that will include five different fragments. In each fragment I need the GPS location of the device but the purpose will be different. In order not to implement FusedLocationProviderClient five times for each fragment, I was thinking of doing this once in MainActivity and sending the results to the displayed fragment. Being a beginner
Tag: android-fragments
I want to use denzcoskun/ImageSlideshow in fragment
I’m trying to use carousel in fragment. I’m using the following library https://github.com/denzcoskun/ImageSlideshow for image slider. In Activity the image slider works, but in fragment it doesn’t work. And there was no particular error in Logcat and Log. It also confirmed that both versions 0.0.6 and 0.1.0 can be done in activity and not in fragment. How can I use
BottomSheetDialogFragment behaviour disorder when added nested fragment in Android
I’ve a BottomSheetDialogFragment inside a RecyclerView, when is clicked a button BottomSheet is showing. BottomSheetDialog expanding when scrolling down and collapsing when scroll finished on top normally. But when I place the RecyclerView inside a fragment and lay the fragment to BottomSheetDialog; BottomSheet behaviours not working on the fragment, only works RecyclerView scrolling. On the other hand the behaviours work
Android NavigationDrawer and Toolbar in all fragments, plus TabLayout into one
I would like to create an Android app that uses a navigation drawer which loads different fragments, all of which include a toolbar/appbar and one that also has a TabView with ViewPager2, something like this: So I started a new Java project with Android Studio and chose the Navigation Drawer Activity template that creates 3 different fragments. This is my
Working on Android Music Player Project, and ran into the issue where my app crashes on start up:
I am trying to add a player using Sliding Up Panel but the app crashes on startup. If you want to see my full code; https://github.com/Kailash8460/poptune.git MainActivity.java activity_main.xml MainFragment.java Here there is no issue on SongsFragment, ArtistFragment and AlbumFragment files, because I have run this application before adding the sliding up panel and that was successfully run but after adding
Why my bookmarked words doesn’t saved to sqlite database if i want to add them from another fragment?
The main problem is that when i add bookmark codes from direct recyclerview it works perfectly fine but when i add those codes to another fragment it just only show a toast that bookmark is added or deleted but that bookmarked word doesn’t show in favorite list. Here is my Database codes My RecyclerView codes My Detalis Fragment codes My
How to open URL from ListView inside fragment?
Wanna make to open website when I click it from ListView. I made it with some youtube videos. Mixed up those youtube videos and of course, It’s not working. What should fix or add more code? I put my every codes to understand it. Need you guys help a lot. Two upper codes are for layout. And last 3 codes
How to ask for permissions in an onClick event from a button inside a dialog fragment
As soon as my app opens up for the first time, a dialog fragment should come up (in the MainActivity), explaining why some permissions are needed, and there is an Accept button at the end. I have set an onClick listener to this button, where I want to show the default popup to ask for the permissions. To do that,
Problem with positioning FloatingActionButton in Fragment
I have problem with positioning FAB inside Fragment. FAB is on the top left, but I need it on the bottom right. What I have wrong? Answer as I have read , FAB doesn’t work with relative layout very well and you should use Coordinator Layout instead. first include its dependency in build.gradle(Module:app) then declare Coordinator Layout like this instead
Adding a ListView in a Fragment
I want to add a ListView to a Fragment. I created a FrameLayout in my activity_main.xml and then created 3 fragments (Home, Tags, Settings). What I did was create a bottom navigation view and created 3 frame layouts for the mentioned fragments. I searched the whole web on how to add a ListView to a Fragment, but whatever code they