Code example for Fragment

Methods: getActivity, onActivityCreated

0
 
    private SessionTracker sessionTracker; 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) { 
        super.onActivityCreated(savedInstanceState); 
        sessionTracker = new SessionTracker(getActivity(), new DefaultSessionStatusCallback()); 
    } 
     
    /** 
     * Called when the activity that was launched exits. This method manages session 
     * information when a session is opened. If this method is overridden in subclasses, 
     * be sure to call {@code super.onActivityResult(...)} first. 
     */ 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) { 
        super.onActivityResult(requestCode, resultCode, data); 
        sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data); 
    } 
 
    @Override