I\'ve got an application that I\'m modernizing. One step of this process is changing to a Fragment based layout (using the Fragments from the support library). I converted m
Just do one this
public class fragmentOne extends Fragment implements OnClickListener {
Button myButton;
@Override
public View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedinstanceState) {
View myView = inflater.inflate(R.layout.fragment_1, container, false);
myButton = (Button) myView.findViewById(R.id.myButton);
myButton.setOnClickListener(this);
return myView;
}
@Override
public void onClick(View v) {
// implements your things
}
}
very simple