Code example for Fragment

Methods: getArgumentsonStart

0
        return inflater.inflate(R.layout.observable_details_view, container, false);
    } 
 
    @Override 
    public void onStart() { 
        super.onStart(); 
 
        // During startup, check if there are arguments passed to the fragment. 
        // onStart is a good place to do this because the layout has already been 
        // applied to the fragment at this point so we can safely call the method 
        // below that sets the article text. 
        Bundle args = getArguments();
        if (args != null) {
            // Set article based on argument passed in 
            updateObservableDetailsView(args.getInt(ARG_POSITION));
        } else if (mCurrentPosition != -1) {
            // Set article based on saved instance state defined during onCreateView 
            updateObservableDetailsView(mCurrentPosition);
        } 
    } 
Connect your IDE to all the code out there  Get Codota for Java