Sending data from nested fragments to parent fragment

后端 未结 8 2032
情深已故
情深已故 2020-11-27 12:27

I have a Fragment FR1 that contains several Nested Fragments; FRa, FRb, FRc. These

8条回答
  •  暖寄归人
    2020-11-27 12:51

    Too late to ans bt i can suggest create EditText object in child fragment

    EditText tx;
    

    in Oncreateview Initialize it. then create another class for bridge like

    public class bridge{
    public static EditText text = null; 
    }
    

    Now in parent fragment get its refrence.

    EditText childedtx = bridge.text;
    

    now on click method get value

    onclick(view v){
    childedtx.getText().tostring();
    }
    

    Tested in my project and its work like charm.

提交回复
热议问题