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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -