Code example for FragmentActivity

Methods: setResult

0
    // Unfortunately setResult is final so it can't be overridden to track the result-definedness state of 
    // the activity, which is used to track unplanned #finish()es and to fire onBackPressed at that time. 
    //@Override 
    //public void setResult() { } 
    /*package*/ void _setResult(int resultCode) {
        setResult(resultCode);
        m_Result = resultCode;
    } 
 
    /** 
     * @internal 
     * Intercepts finish calls triggered by activitySetFinishOnTouchOutside by detecting whether a result has been 
     * specified yet. 
     */ 
    @Override 
    public void finish() { 
        if (m_Result == null) {
            onBackPressed(); 
        } else { 
            super.finish(); 
        }