android - How to work a button inside a fragment -


I have used a piece (which has two buttons inside), but I have no way to do this button. . Keep in mind that I use an activity that is linked to a specific piece.

Does anyone know a button to open the button in the Android SDK device?

This sample will help you do not forget to make a layout with buttons for this piece

 public square sampleframe fragment extension {personal button mButton = null; Public Sample Fragment () {} @ Override Public Zero on Destroyview () {super.onDestroyView (); } @ Override Crate on Public Zero (Bundle Saved Instantstate) {Super.Nought (Saved Instantstate); } @ Override Public View Crate View (LayoutInflator Inflator, View Group Container, Bundle Saved InstantState) {View View = inflater.inflate (R.layout.sample_fragment, Container, Incorrect); MButton = (TextView) view.findViewById (R.id.button1); mButton.setOnClickListener (New View.OnClickListener () {@Override Click Public Zero (see V) {// button your buttons on action}}); Return view; }}   

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -