Code example for Fragment

Methods: onCreateView

0
public class HexFragment extends Fragment {
    private ViewGroup mContainer;
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = super.onCreateView(inflater, container, savedInstanceState);
        mContainer = container;
        return v;
    } 
 
    @Override 
    public void onStart() { 
        super.onStart(); 
        mContainer.requestFocus();
    } 
 
    protected MainActivity getMainActivity() { 
        return (MainActivity) getActivity();
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE