How to find a custom fragment from an inflated layout?











up vote
0
down vote

favorite












I have a custom fragment in a inflated layout, how to access it?
I have tried many ways after inflated, but none of them worked:





  1. getTransitionManager().findFragmentById(id_xxxxx) returns null;


  2. getChildAt(x), get a View but not be able to cast to fragment;

  3. I Tried to create a new fragment programmatically, and add to a container in the inflated view, but the app crashed says "No view found for id xxx for fragment fff"


code, I want to find ReportCalenderFragment and hold it:



    @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...

LayoutInflater inflater = LayoutInflater.from(getActivity());
mCalendar = inflater.inflate(R.layout.dlg_choose_report, null);

ConstraintLayout ly = (ConstraintLayout)mCalendar;
RelativeLayout rly = (RelativeLayout)ly.getChildAt(0);
LinearLayout lly = (LinearLayout)rly.getChildAt(0);
View v = (View)lly.getChildAt(0);

//lly.setId(R.id.report_calendar_con);
//ReportCalenderFragment frag = new ReportCalenderFragment();
//FragmentTransaction fragTrans = getChildFragmentManager().beginTransaction();
//fragTrans.add(R.id.report_calendar_con, frag);
//fragTrans.commit();
//ReportCalenderFragment frag = (ReportCalenderFragment)lly.getChildAt(0);

...
}


XML, ConstraintLayout was filtered by this text editor:



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/report_calendar_con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="#000"
android:orientation="vertical">

<fragment
android:id="@+id/frag_calendar_rp"
android:name="package.fragments.ReportCalenderFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" />
</LinearLayout>

</RelativeLayout>

</android.support.constraint.ConstraintLayout>









share|improve this question
























  • Paste your code
    – Sarath Kn
    Nov 19 at 6:49










  • @Sarath, code pasted
    – voyagex6
    Nov 19 at 6:58










  • Are you inflating the layout inside a fragment?
    – Sarath Kn
    Nov 19 at 7:14










  • @Sarath, Yes, I am. And this layout is used as a custom view in a Dialog
    – voyagex6
    Nov 19 at 7:15












  • You mean, you have a fragment, where you show a dialog fragment, and inside that dialog fragment's layout you have another fragment?
    – Sarath Kn
    Nov 19 at 7:23















up vote
0
down vote

favorite












I have a custom fragment in a inflated layout, how to access it?
I have tried many ways after inflated, but none of them worked:





  1. getTransitionManager().findFragmentById(id_xxxxx) returns null;


  2. getChildAt(x), get a View but not be able to cast to fragment;

  3. I Tried to create a new fragment programmatically, and add to a container in the inflated view, but the app crashed says "No view found for id xxx for fragment fff"


code, I want to find ReportCalenderFragment and hold it:



    @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...

LayoutInflater inflater = LayoutInflater.from(getActivity());
mCalendar = inflater.inflate(R.layout.dlg_choose_report, null);

ConstraintLayout ly = (ConstraintLayout)mCalendar;
RelativeLayout rly = (RelativeLayout)ly.getChildAt(0);
LinearLayout lly = (LinearLayout)rly.getChildAt(0);
View v = (View)lly.getChildAt(0);

//lly.setId(R.id.report_calendar_con);
//ReportCalenderFragment frag = new ReportCalenderFragment();
//FragmentTransaction fragTrans = getChildFragmentManager().beginTransaction();
//fragTrans.add(R.id.report_calendar_con, frag);
//fragTrans.commit();
//ReportCalenderFragment frag = (ReportCalenderFragment)lly.getChildAt(0);

...
}


XML, ConstraintLayout was filtered by this text editor:



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/report_calendar_con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="#000"
android:orientation="vertical">

<fragment
android:id="@+id/frag_calendar_rp"
android:name="package.fragments.ReportCalenderFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" />
</LinearLayout>

</RelativeLayout>

</android.support.constraint.ConstraintLayout>









share|improve this question
























  • Paste your code
    – Sarath Kn
    Nov 19 at 6:49










  • @Sarath, code pasted
    – voyagex6
    Nov 19 at 6:58










  • Are you inflating the layout inside a fragment?
    – Sarath Kn
    Nov 19 at 7:14










  • @Sarath, Yes, I am. And this layout is used as a custom view in a Dialog
    – voyagex6
    Nov 19 at 7:15












  • You mean, you have a fragment, where you show a dialog fragment, and inside that dialog fragment's layout you have another fragment?
    – Sarath Kn
    Nov 19 at 7:23













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a custom fragment in a inflated layout, how to access it?
I have tried many ways after inflated, but none of them worked:





  1. getTransitionManager().findFragmentById(id_xxxxx) returns null;


  2. getChildAt(x), get a View but not be able to cast to fragment;

  3. I Tried to create a new fragment programmatically, and add to a container in the inflated view, but the app crashed says "No view found for id xxx for fragment fff"


code, I want to find ReportCalenderFragment and hold it:



    @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...

LayoutInflater inflater = LayoutInflater.from(getActivity());
mCalendar = inflater.inflate(R.layout.dlg_choose_report, null);

ConstraintLayout ly = (ConstraintLayout)mCalendar;
RelativeLayout rly = (RelativeLayout)ly.getChildAt(0);
LinearLayout lly = (LinearLayout)rly.getChildAt(0);
View v = (View)lly.getChildAt(0);

//lly.setId(R.id.report_calendar_con);
//ReportCalenderFragment frag = new ReportCalenderFragment();
//FragmentTransaction fragTrans = getChildFragmentManager().beginTransaction();
//fragTrans.add(R.id.report_calendar_con, frag);
//fragTrans.commit();
//ReportCalenderFragment frag = (ReportCalenderFragment)lly.getChildAt(0);

...
}


XML, ConstraintLayout was filtered by this text editor:



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/report_calendar_con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="#000"
android:orientation="vertical">

<fragment
android:id="@+id/frag_calendar_rp"
android:name="package.fragments.ReportCalenderFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" />
</LinearLayout>

</RelativeLayout>

</android.support.constraint.ConstraintLayout>









share|improve this question















I have a custom fragment in a inflated layout, how to access it?
I have tried many ways after inflated, but none of them worked:





  1. getTransitionManager().findFragmentById(id_xxxxx) returns null;


  2. getChildAt(x), get a View but not be able to cast to fragment;

  3. I Tried to create a new fragment programmatically, and add to a container in the inflated view, but the app crashed says "No view found for id xxx for fragment fff"


code, I want to find ReportCalenderFragment and hold it:



    @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...

LayoutInflater inflater = LayoutInflater.from(getActivity());
mCalendar = inflater.inflate(R.layout.dlg_choose_report, null);

ConstraintLayout ly = (ConstraintLayout)mCalendar;
RelativeLayout rly = (RelativeLayout)ly.getChildAt(0);
LinearLayout lly = (LinearLayout)rly.getChildAt(0);
View v = (View)lly.getChildAt(0);

//lly.setId(R.id.report_calendar_con);
//ReportCalenderFragment frag = new ReportCalenderFragment();
//FragmentTransaction fragTrans = getChildFragmentManager().beginTransaction();
//fragTrans.add(R.id.report_calendar_con, frag);
//fragTrans.commit();
//ReportCalenderFragment frag = (ReportCalenderFragment)lly.getChildAt(0);

...
}


XML, ConstraintLayout was filtered by this text editor:



<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/report_calendar_con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="#000"
android:orientation="vertical">

<fragment
android:id="@+id/frag_calendar_rp"
android:name="package.fragments.ReportCalenderFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" />
</LinearLayout>

</RelativeLayout>

</android.support.constraint.ConstraintLayout>






android






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 8:16

























asked Nov 19 at 6:47









voyagex6

33




33












  • Paste your code
    – Sarath Kn
    Nov 19 at 6:49










  • @Sarath, code pasted
    – voyagex6
    Nov 19 at 6:58










  • Are you inflating the layout inside a fragment?
    – Sarath Kn
    Nov 19 at 7:14










  • @Sarath, Yes, I am. And this layout is used as a custom view in a Dialog
    – voyagex6
    Nov 19 at 7:15












  • You mean, you have a fragment, where you show a dialog fragment, and inside that dialog fragment's layout you have another fragment?
    – Sarath Kn
    Nov 19 at 7:23


















  • Paste your code
    – Sarath Kn
    Nov 19 at 6:49










  • @Sarath, code pasted
    – voyagex6
    Nov 19 at 6:58










  • Are you inflating the layout inside a fragment?
    – Sarath Kn
    Nov 19 at 7:14










  • @Sarath, Yes, I am. And this layout is used as a custom view in a Dialog
    – voyagex6
    Nov 19 at 7:15












  • You mean, you have a fragment, where you show a dialog fragment, and inside that dialog fragment's layout you have another fragment?
    – Sarath Kn
    Nov 19 at 7:23
















Paste your code
– Sarath Kn
Nov 19 at 6:49




Paste your code
– Sarath Kn
Nov 19 at 6:49












@Sarath, code pasted
– voyagex6
Nov 19 at 6:58




@Sarath, code pasted
– voyagex6
Nov 19 at 6:58












Are you inflating the layout inside a fragment?
– Sarath Kn
Nov 19 at 7:14




Are you inflating the layout inside a fragment?
– Sarath Kn
Nov 19 at 7:14












@Sarath, Yes, I am. And this layout is used as a custom view in a Dialog
– voyagex6
Nov 19 at 7:15






@Sarath, Yes, I am. And this layout is used as a custom view in a Dialog
– voyagex6
Nov 19 at 7:15














You mean, you have a fragment, where you show a dialog fragment, and inside that dialog fragment's layout you have another fragment?
– Sarath Kn
Nov 19 at 7:23




You mean, you have a fragment, where you show a dialog fragment, and inside that dialog fragment's layout you have another fragment?
– Sarath Kn
Nov 19 at 7:23












2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










Try



ReportCalenderFragment frag  = (ReportCalenderFragment) getParentFragment().getFragmentManager().findFragmentById(R.id.frag_calendar_rp);


If you are using ReportCalenderFragment inside a dialog, which is inside another fragment



You should use the ChildFragmentmanager from parent fragment while showing the dialog



MyDialogFragment dialogFragment = new MyDialogFragment();
dialogFragment.show(getChildFragmentManager(), "dialog");





share|improve this answer























  • The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
    – voyagex6
    Nov 19 at 8:13










  • It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
    – voyagex6
    Nov 19 at 14:49




















up vote
0
down vote













Like this:



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);//this method
Log.e(getClass().getSimpleName(),fragment.toString());
}





share|improve this answer























  • There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
    – voyagex6
    Nov 19 at 7:07












  • Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
    – Justin
    Nov 19 at 7:21













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53369585%2fhow-to-find-a-custom-fragment-from-an-inflated-layout%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










Try



ReportCalenderFragment frag  = (ReportCalenderFragment) getParentFragment().getFragmentManager().findFragmentById(R.id.frag_calendar_rp);


If you are using ReportCalenderFragment inside a dialog, which is inside another fragment



You should use the ChildFragmentmanager from parent fragment while showing the dialog



MyDialogFragment dialogFragment = new MyDialogFragment();
dialogFragment.show(getChildFragmentManager(), "dialog");





share|improve this answer























  • The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
    – voyagex6
    Nov 19 at 8:13










  • It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
    – voyagex6
    Nov 19 at 14:49

















up vote
0
down vote



accepted










Try



ReportCalenderFragment frag  = (ReportCalenderFragment) getParentFragment().getFragmentManager().findFragmentById(R.id.frag_calendar_rp);


If you are using ReportCalenderFragment inside a dialog, which is inside another fragment



You should use the ChildFragmentmanager from parent fragment while showing the dialog



MyDialogFragment dialogFragment = new MyDialogFragment();
dialogFragment.show(getChildFragmentManager(), "dialog");





share|improve this answer























  • The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
    – voyagex6
    Nov 19 at 8:13










  • It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
    – voyagex6
    Nov 19 at 14:49















up vote
0
down vote



accepted







up vote
0
down vote



accepted






Try



ReportCalenderFragment frag  = (ReportCalenderFragment) getParentFragment().getFragmentManager().findFragmentById(R.id.frag_calendar_rp);


If you are using ReportCalenderFragment inside a dialog, which is inside another fragment



You should use the ChildFragmentmanager from parent fragment while showing the dialog



MyDialogFragment dialogFragment = new MyDialogFragment();
dialogFragment.show(getChildFragmentManager(), "dialog");





share|improve this answer














Try



ReportCalenderFragment frag  = (ReportCalenderFragment) getParentFragment().getFragmentManager().findFragmentById(R.id.frag_calendar_rp);


If you are using ReportCalenderFragment inside a dialog, which is inside another fragment



You should use the ChildFragmentmanager from parent fragment while showing the dialog



MyDialogFragment dialogFragment = new MyDialogFragment();
dialogFragment.show(getChildFragmentManager(), "dialog");






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 19 at 8:07

























answered Nov 19 at 7:37









Sarath Kn

1,522918




1,522918












  • The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
    – voyagex6
    Nov 19 at 8:13










  • It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
    – voyagex6
    Nov 19 at 14:49




















  • The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
    – voyagex6
    Nov 19 at 8:13










  • It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
    – voyagex6
    Nov 19 at 14:49


















The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
– voyagex6
Nov 19 at 8:13




The ReportCalenderFragment is not inside another fragment, it's in a layout of the presented xml file. Actually I used getChildFragmentManager() before. I forgot to mention the code is in the onCreate() method of the mother fragment.
– voyagex6
Nov 19 at 8:13












It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
– voyagex6
Nov 19 at 14:49






It seems DialogFragment is a much more appropriate method to deal with a custom dialog than inflating a view, your answer inspired me to use a DialogFragment instead , thx
– voyagex6
Nov 19 at 14:49














up vote
0
down vote













Like this:



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);//this method
Log.e(getClass().getSimpleName(),fragment.toString());
}





share|improve this answer























  • There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
    – voyagex6
    Nov 19 at 7:07












  • Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
    – Justin
    Nov 19 at 7:21

















up vote
0
down vote













Like this:



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);//this method
Log.e(getClass().getSimpleName(),fragment.toString());
}





share|improve this answer























  • There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
    – voyagex6
    Nov 19 at 7:07












  • Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
    – Justin
    Nov 19 at 7:21















up vote
0
down vote










up vote
0
down vote









Like this:



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);//this method
Log.e(getClass().getSimpleName(),fragment.toString());
}





share|improve this answer














Like this:



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);//this method
Log.e(getClass().getSimpleName(),fragment.toString());
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 19 at 7:23

























answered Nov 19 at 6:59









Justin

12




12












  • There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
    – voyagex6
    Nov 19 at 7:07












  • Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
    – Justin
    Nov 19 at 7:21




















  • There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
    – voyagex6
    Nov 19 at 7:07












  • Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
    – Justin
    Nov 19 at 7:21


















There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
– voyagex6
Nov 19 at 7:07






There was no error in both fragment and layout, the app can display the inflated layout, but I want to hold the fragment to do something
– voyagex6
Nov 19 at 7:07














Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
– Justin
Nov 19 at 7:21






Use getSupportFragmentManager().findFragmentById. Like this: ReportCalenderFragment fragment= (ReportCalenderFragment) getSupportFragmentManager().findFragmentById(R.id.frag_calendar_rp);
– Justin
Nov 19 at 7:21




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53369585%2fhow-to-find-a-custom-fragment-from-an-inflated-layout%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]