package com.icecondor.eaglet.ui.login;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.icecondor.eaglet.Constants;
import com.icecondor.eaglet.R;

public class LoginFragment extends Fragment {
    private TextView statusView;

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d(Constants.APP_TAG, "LoginFragment onActivityCreated");
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        Log.d(Constants.APP_TAG, "LoginFragment onCreateView");
        View rootView = inflater.inflate(R.layout.fragment_login,
                               container, false);
        statusView = (TextView)rootView.findViewById(R.id.login_status_msg);
        return rootView;
    }

    public void setStatusText(String text) {
        statusView.setText(text);
    }

}

@@ -1067,24 +1067,116 @@
 ing text) %7B%0A
+        // this can be called before statusView exists%0A        if(statusView != null) %7B%0A    
         stat
@@ -1197,16 +1197,26 @@
 (text);%0A
+        %7D%0A
     %7D%0A%0A%7D

test for view before using it