279 questions
2
votes
1
answer
62
views
Recycler view doesn't render inside Fragment
I have a fragment where I am trying to display a recyclerview with few data. But nothing seems to be working, the emulator finally shows a blank screen.
The PreferenceMenuFragment is added via xml ...
0
votes
0
answers
215
views
Replacing fragment with multi fragments (nested fragments) in Android (Kotlin) not working
I'm trying to instantiate a fragment and have it replace another fragment. Looking at multiple sources hasn't worked, yet. When I use the findNavController to see if the other fragment does indeed ...
0
votes
0
answers
499
views
Android: Handle back button in nested fragments
I'm handling back button of device via fragments but while calling from nested fragments I'm facing issue. It always calls the backPressed method of MainActivity. I'm handling it as:
class ...
0
votes
0
answers
99
views
SingleLiveEvent with conditional trigger
I am using nested fragments so fragment1 opens fragment2 and they share a viewmodel.
This viewmodel calls a repository to get data and using a LiveData it posts the result and then fragment2 displays ...
0
votes
1
answer
370
views
No view found for id 0x7f0a01a2...for fragment
I have an Activity A which implements NavigationView.OnNavigationItemSelectedListener that connects it to fragments 1, 2, 3. Fragment 1 has a viewPager and a pagerAdapter which connects it to fragment ...
0
votes
0
answers
148
views
NestedFragment in DialogFragment
I have a DialogFragment which contains a FragmentContainerView with the following layout:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget....
0
votes
1
answer
26
views
OnMapReadyCallback not transmitted to parent fragment in nested multipane layout using Navhost
I have Navhost which contains photo fragment and map fragment.
Map fragment is working when I use it alone, but when I try to integrate it in parent fragment I can scroll map but I cannot use any ...
0
votes
0
answers
108
views
Nested Fragments doesn't back to the previous one
In main Activity I show new DialogFragment which is ParentFragment with only 1 frameLayout in it. From this fragment i add new Fragment into frame layout. (Fragment A)
val fragment = ...
2
votes
0
answers
699
views
Retain Backstack for Bottom Navigation Bar Android Studio (Java)
as per my name I am new to this, and need help.
This is a simple app with one main activity that has a bottom navigation bar used to navigate to multiple different fragments. In the main activity, ...
0
votes
2
answers
2k
views
Nested fragment deep link back stack handling
I have below screen hierarchy
[Activity1] -> [fragment1] -> [fragment2] -> [fragment3]
I have a deep-link which should open [Activity1] with [fragment3].
On back press, It should navigate to [...
1
vote
1
answer
347
views
Unable to NotifyDataSetChanged on a RecyclerView when EditText is in Focus
I have an Activity with a fragment called MainFragment which has a ViewPager2 to display a few Fragments. One of which is SearchFragment. SearchFragment has an EditText with a TextWatcher, upon text ...
0
votes
1
answer
34
views
multiple fragments - where to commit them?
I'm trying to wrap my head around how and where i should be setting up my fragments.
Use case senario i'm trying to implement
I have a mainActivity that has a bottomNigationView widget that will open ...
-1
votes
1
answer
156
views
How to get value from childfragment to parentfragment?
I am frustrated.
i want to get value from child fragment to parent fragment
i had tries many method.
interface, viewModel, sharedpreferences but no one work.
I had follow this method
but it doesn't ...
2
votes
0
answers
239
views
In nested Fragment,when TabLayout changes new instance of fragment added but RecyclerView not updating
I have a Fragment named HomeFragment, consisting of a TabLayout and ViewPager in it. TabLayout is populated with data from backend. So each tab item has a name and on changing the tab position, I ...
4
votes
4
answers
6k
views
How to manage Backstack with child fragments?
I am having issues with nested/child fragments. My use case is: I have Frag A as parent fragment and FragChild1, FragChild2, FragChild3 as child fragments to be displayed inside Frag A. Now on back ...
1
vote
1
answer
940
views
Navigating back from nested fragments in ViewPager
I need to display multiple set of instructions to the user. For each instruction(FragmentA) the user can navigate to another screen (FragmentA1). I have used a ViewPager that hold list of fragments. ...
3
votes
0
answers
313
views
RecyclerView does not scroll in Nested Fragment
I am using NavigationDrawer and on item selection, I am changing fragment using hide/show technique instead of replace.
if(fragmentManager.findFragmentByTag(TAG_TASKS_FRAGMENT) != null){
...
0
votes
1
answer
2k
views
getParentFragment() in fragments is returning null when fragment is popped out from backstack
I have an activity containg framelayout, fragment A is hosted with getSupportFragmentManager() in this.
This fragment A hosts two more fragments which has recycler views in it -Fragment A1 and ...
0
votes
2
answers
684
views
Android Nested Fragment and Interface
I have a Fragment A which has an interface that will return the value of a TextView. The Fragment A is initialized and Attached to FragmentB. Here is the code for Fragment A and B.
Fragment A
...
0
votes
1
answer
140
views
Class Cast Exception retrieving Chosen date from childfragment to show in parent fragment
I have a parentfragment called Planning in which I want to show a DialogFragment called DatePickerfragment.The DatePickerFragment has a button that when clicked, will show a datepicker for the user. ...
1
vote
1
answer
258
views
List View inside ViewPager using nested fragments - huge performance drop
as in topic i have huge problem with optymalization of my activity.
wireframe
At root level we have three controls:
- Tab Layout, related with ViewPager
- SurfaceView displaying plot for every ...
2
votes
1
answer
202
views
Fragment inside a viewpager doesnt show when is in recyclerview
Maybe this is a stupid question, but this is ruining my day...
I have a recyclerview in a fragment
override fun setUpRecyclerView(pics: List<Pictures>) {
recyclerView.setHasFixedSize(true)
...
1
vote
0
answers
4k
views
IllegalStateException Fragment already added - Android
I am adding fragment like bellow :
@OnClick(R.id.lnNews)
void newsList() {
String tagName = returnStatusFragment(getString(R.string.news_list_fragment));
if (!TextUtils.isEmpty(tagName) &&...
0
votes
0
answers
536
views
Tabs (with fragments) within Fragment
I created the tabs by following this https://www.youtube.com/watch?v=zcnT-3F-9JA but in this tutorial the tabs are within an activity where as I need them within fragments something like nested ...
-1
votes
1
answer
670
views
ChildFragmentManager null object reference from parentFragment
I am working on a simple application and replacing fragments on top of the parent fragment.I am using below code for opening child fragments.This is the code which I am using in PendingFragment to ...
3
votes
1
answer
1k
views
Nested fragments no view found for id
I am working on simple application having nested fragments with tab layout. Parent activity is LandingActivity. Inside of the LandingActivity i am calling LandingFragment. Inside of the ...
0
votes
0
answers
447
views
Child fragment disappears when keyboard pops up
UPDATE 1:
Adding android:windowSoftInputMode="adjustPan" in manifest file solved the problem for portrait mode. But in landscape mode the problem still exists.
ORIGINAL QUESTION:
Current structure ...
0
votes
1
answer
753
views
Google Places Auto Complete fragment causes duplicate id error
Hi I am using google's places autocomplete api in my app. I need the google places fragment in another fragment and have got it working. Basically I have a tab with 3 imagviews and when you click on ...
0
votes
0
answers
75
views
implementing nested fragments
I have a GenericContainer That extends an activity.
GenericContainer takes case of my fragments, i am using viewStubs to populate them.
How to implement nested fragments in GenericContainer. I will ...
18
votes
2
answers
2k
views
Nested fragments transitioning incorrectly
Hello good programmers of stack overflow! I've spent a good week with this problem and am now very desperate for a solution.
The scenario
I'm using android.app.Fragment's not to be confused with the ...
1
vote
1
answer
499
views
How to make onActivityResult get called on nested fragment from viewpager
This is a famous problem of getting result from activity to a nested fragment, the activity could send the result to only the Fragment that has been attached directly to Activity but not the nested ...
0
votes
1
answer
41
views
Nested fragment issue - frag1 calls frag2 which has an impact on the listview from frag1
I thought that calls to a fragment were synchronous but it's not. I have a fragment 1 that contains a listview that I update through an adapter. Then I have a button that launches fragment 2. Frag2 ...
1
vote
3
answers
764
views
Nested fragments - Screen of Frag2 stays empty
I'm suffering through nested fragments. I have a mainactivity which calls a fragment 1 which in turns call a fragment via a button. The fragment frag2 is well instantiated but the screen is blank.
Is ...
-1
votes
2
answers
479
views
Fragment A calls fragment B - B does a popbackstack - where does it return in A [duplicate]
I cant' find where it returns in Fragment A after a call to fragment B.
Fragment A calls fragment Test as follows:
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(...
0
votes
1
answer
123
views
nestedviewpager nested fragment error
I have a Viewpager contains Recylerview which has 2 different holders. One of them is also view pager. Hence I have nested viewpager nad nested fragments. When I tap the second tab and tap back the ...
0
votes
2
answers
3k
views
Nested Child Fragment with Viewpager
Currently, I am trying to create a nested view pager using a fragment, how can I access top parent function to refresh the View?
Let's say I have:
public class ParentFragment extends Fragment {
...
1
vote
2
answers
1k
views
How to use nested fragments with getChildFragmentManager()?
Edit: Hey guys I have deleted everything because I finally found the answer to my question (basically how to use a scrollview inside ViewPager inside a fragment). Here is my code for everything. I am ...
3
votes
3
answers
7k
views
Call child Fragment method from parent fragment when child view is available?
I have searched for solution and found so many cases (not relevant to my situation or may be i didn't understood them properly).
My case is :
Let's say i have one parent Fragment Parent;
And i'm ...
0
votes
1
answer
355
views
Android: Updating a nested fragment from another fragment
I have two fragments, Fragment A and Fragment B. Fragment A contains 4 tabs as shown below:
Tab 3 has recycler view, from which user will select an option. Now user will go to Fragment B, and does ...
5
votes
1
answer
5k
views
Nested fragments getchildfragmentmanager causing crash
I have viewPager which contains fragments each of these fragment has viewpager to display Images and banners
now to each fragment Image adapter I am passing getChildFragmentManager() as below
...
6
votes
1
answer
1k
views
Exception when trying to save state of nested fragment [Fragment no longer exists for key android:target_state]
In order to focus on the problem I will simplify the case to the following - I have an activity A and a fragment F which is adding another fragment Child. The simplified code of each is
Activity A
@...
0
votes
1
answer
2k
views
Fragment's childfragmentmanager getFragments() return null after replace
I have MainActivity and has a FragmentLayout inside. I am showing different fragments inside that layout when tabs selected (like instagram) with this code.
MABaseFragment fragment = ...
0
votes
1
answer
720
views
Working with OptionsMenu in nested fragment not updating
I displayed a fragment A that implements a ViewPager with several fragments (nested fragments).
In my nested fragments, I inflate a menu with the following method.
@Override
public void ...
0
votes
2
answers
82
views
Fragment Layout Not Adding Up More Views
I'm trying to add a FrameLayout in my fragment layout, just to reserve space to add another fragment, programmatically. Here's code :
FRAGMENT XML LAYOUT
<?xml version="1.0" encoding="utf-8"?>
...
1
vote
2
answers
2k
views
Nested fragment and back stack
I have a fragment in which there is a nested fragment which I add in this way:
if (home == null) {
home = new MyFragment();
FragmentTransaction transaction ...
1
vote
1
answer
93
views
Nested fragment filling the rest of the space
I would like to have a nested fragment which should take the rest of the space. The problem is that it even doesn't show because the height is 1 px. If I set the height to 300 dp for example ...
1
vote
2
answers
2k
views
Back in fragment and nested fragment
i have app like this
one activity and inside it >
fragment a (loaded when run app also from menu can open it )
fragment b (open it from just menu)
fragment c (can open it from fragment a and also ...
1
vote
1
answer
57
views
Setting InteractionListener with inner fragment
As far as I know it is recommended to attach InteractionListener interface to a fragment inside the onAttach method like this
@Override
public void onAttach(Activity activity) {
super.onAttach(...
-1
votes
1
answer
2k
views
Nested fragment-No activity to handle intent
I have an activity with fragment A added to it dynamically. Now, I transact from fragment A to fragment B. And then from fragment B to fragment C. Now I have a button here when clicked will place a ...
2
votes
1
answer
1k
views
Android custom view and nested fragments
I have a parent fragment in my view in which 2 child fragments are added programmatically to display maps. This is the layout for the child fragment, the map is rendered in FrameLayout.
...