Code example for Fragment

Methods: getActivity, getArguments, getId

0
 
        mWebView.loadDataWithBaseURL("http://www.janrain.com/blogs/", htmlString, "text/html", "UTF-8", "");
    } 
 
    public int getShownIndex() { 
        return getArguments().getInt("index", 0);
    } 
 
    public Story getShownStory() { 
        return mQuickShare.getFeed().get(getShownIndex());
    } 
     
    public void onClick(View view) {
        if (getActivity() instanceof StoryDetailActivity) {
            ((StoryDetailActivity) getActivity()).startWaiting();
        } 
 
        JRActivityObject jra = mQuickShare.getFeed().get(getShownIndex()).toJRActivityObject();
        if (AndroidUtils.isXlarge() && AndroidUtils.isLandscape()) { 
            mQuickShare.getJREngage().showSocialPublishingFragment(jra, getActivity(), getId(), true,
                    null, null, null, null); 
        } else { 
            mQuickShare.getJREngage().showSocialPublishingDialog(getActivity(), jra);
        } 
    } 
}