Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_create_group, container, false); editTextName = (EditText) rootView.findViewById(R.id.text_group_name); editTextName.addTextChangedListener(textWatcher); editTextDesc = (EditText) rootView.findViewById(R.id.text_group_desc); editTextDesc.addTextChangedListener(textWatcher); addButton = (Button) rootView.findViewById(R.id.next_create_group); addButton.setOnClickListener(this); TextView shareAppButton = (TextView)rootView.findViewById(R.id.btn_share_app); CharSequence message = ResourceUtil.getFormattedString(getResources(), R.string.btn_share_app, "platform_name", config.getPlatformName()); shareAppButton.setText(message); shareAppButton.setOnClickListener(this); errorLayout = rootView.findViewById(R.id.error_layout); progress = rootView.findViewById(R.id.progress); formLayout = rootView.findViewById(R.id.create_group_form); CharSequence errorText = ResourceUtil.getFormattedString(getResources(), R.string.error_no_friends_connected, "platform_name", config.getPlatformName()); TextView errorMessage = (TextView)rootView.findViewById(R.id.error_message); errorMessage.setText(errorText); connectedText = (TextView) rootView.findViewById(R.id.group_create_facebook_text); connectedText.setOnClickListener(this); SocialProvider socialProvider = new FacebookProvider(); socialProvider.getUser(getActivity(), new SocialProvider.Callback<SocialMember>() { @Override public void onSuccess(SocialMember response) { currentUser = response; insertUserName(response.getFullName()); connectedText.setVisibility(View.VISIBLE); } @Override public void onError(SocialProvider.SocialError err) { connectedText.setVisibility(View.GONE); } }); refreshVisibility(); uiHelper = IUiLifecycleHelper.Factory.getInstance(getActivity(), null); uiHelper.onCreate(savedInstanceState); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_create_group, container, false); editTextName = (EditText) rootView.findViewById(R.id.text_group_name); editTextName.addTextChangedListener(textWatcher); editTextDesc = (EditText) rootView.findViewById(R.id.text_group_desc); editTextDesc.addTextChangedListener(textWatcher); addButton = (Button) rootView.findViewById(R.id.next_create_group); addButton.setOnClickListener(this); TextView shareAppButton = (TextView)rootView.findViewById(R.id.btn_share_app); CharSequence message = ResourceUtil.getFormattedString(getResources(), R.string.btn_share_app, "platform_name", config.getPlatformName()); shareAppButton.setText(message); shareAppButton.setOnClickListener(this); errorLayout = rootView.findViewById(R.id.error_layout); progress = rootView.findViewById(R.id.progress); formLayout = rootView.findViewById(R.id.create_group_form); CharSequence errorText = ResourceUtil.getFormattedString(getResources(), R.string.error_no_friends_connected, "platform_name", config.getPlatformName()); TextView errorMessageView = (TextView)rootView.findViewById(R.id.error_message); errorMessageView.setText(errorText); connectedText = (TextView) rootView.findViewById(R.id.group_create_facebook_text); connectedText.setOnClickListener(this); SocialProvider socialProvider = new FacebookProvider(); socialProvider.getUser(getActivity(), new SocialProvider.Callback<SocialMember>() { @Override public void onSuccess(SocialMember response) { currentUser = response; insertUserName(response.getFullName()); connectedText.setVisibility(View.VISIBLE); } @Override public void onError(SocialProvider.SocialError err) { connectedText.setVisibility(View.GONE); } }); refreshVisibility(); uiHelper = IUiLifecycleHelper.Factory.getInstance(getActivity(), null); uiHelper.onCreate(savedInstanceState); return rootView; }