android - How to get FragmentManager in a class extends LinearLayout? -
i've got class titleview extends linearlayout button in it. since there servral uis need class , included in layout xml files. need start preferencefragment after button pressed, can't use getfragmentmanager() obtain fragmentmanager control preferencefragment in titleview.
can me out ? lot :)
class titleview extends linearlayout { private fragmentactivity mactivity; /** * @param of type null * @return mactivity of type fragmentactivity * getter function mactivity * @since may 3, 2013 * @author rajeshcp */ public fragmentactivity getmactivity() { return mactivity; } /** * @param mactivity of type fragmentactivity * @return of type null * setter function mactivity * @since may 3, 2013 * @author rajeshcp */ public void setmactivity(fragmentactivity mactivity) { this.mactivity = mactivity; mactivity.getsupportfragmentmanager(); } public titleview(context context) { super(context); } } ((titleview)findviewbyid(r.id.your_lay_out_id)).setmactivity(yourfragmentactivity); mactivity.getsupportfragmentmanager();
Comments
Post a Comment