Code example for Fragment

Methods: onSaveInstanceState, setUserVisibleHint

0
     * http://stackoverflow.com/questions/8748064/starting-activity-from 
     * -fragment-causes-nullpointerexception 
     */ 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        setUserVisibleHint(true);
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.help_fragment_about, container, false);
 
        // load html from html file from /res/raw 
        InputStream inputStreamText = this.getActivity().getResources()
                .openRawResource(R.raw.help_about);
 
        TextView versionText = (TextView) view.findViewById(R.id.help_about_version);
        versionText.setText(getString(R.string.help_about_version) + " " + getVersion());
 
        JellyBeanSpanFixTextView aboutTextView = (JellyBeanSpanFixTextView) view