Alternative way for Fragment to Activity communication
<p>Note, this is an official way for <code>Fragment</code> to <code>Activity</code> communication, according to <a href="http://developer.android.com/training/basics/fragments/communicating.html" rel="nofollow">http://developer.android.com/training/basics/fragments/communicating.html</a></p>

<pre><code>public class HeadlinesFragment extends ListFragment {
    OnHeadlineSelectedListener mCallback;

    // Container Activity must implement this interface
    public interface OnHeadlineSelectedListener {
        public void onArticleSelected(int position);
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        // This makes sure that the container activity has implemented
        // the callback interface. If not, it throws an exception
        try {
            mCallback = (OnHeadlineSelectedListener) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                    + " must implement OnHeadlineSelectedListener");
        }
    }

    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
        // Send the event to the host activity
        mCallback.onArticleSelected(position);
    }
}
</code></pre>

<p>However, I had came across code which performs the following technique.</p>

<pre><code>    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
        // Send the event to the host activity
        ((OnHeadlineSelectedListener)this.getActivity()).onArticleSelected(position);
    }
</code></pre>

<p>I tested so far it works, even after configuration change, I still get the latest <code>Activity</code>.</p>

<p>I just wondering, is there any catch behind this method, besides method recommended by Google? For instance, can <code>getActivity</code> even return null?</p>
