java - calling View inside a View in android -


how call view inside view on click of button in android. here code:

public class fragment2 extends fragment1 {     public fragment2() {}      @override     public void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);     }      public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {         view view = inflater.inflate(r.layout.fragment_layout_one, container, false);          button.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {                 // how call here             }         });         return view;     }  } 

is there way call view on click of button.

if understand issue correctly, then, possibly looking this:

public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {     view view = inflater.inflate(r.layout.fragment_layout_one, container, false);     fragmenttransaction transaction = getfragmentmanager().begintransaction();      button.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {               transaction.replace(r.id.fragment_container, newfragment);               transaction.commit();             }         });     return view; } 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -