Code example for Fragment

Methods: getLoaderManager, onActivityCreated

0
    text2 = (TextView)view.findViewById(R.id.profile_text2);
  } 
 
  @Override 
  public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getLoaderManager().initLoader(LOADER_ID, null, this);
  } 
 
  @Override 
  public Loader<ResponseData<Profile>> onCreateLoader(final int arg0, final Bundle arg1) {
    return new SimpleRequestBuilder<Profile>(getActivity()) { }
      .setUrl("https://api.twitter.com/1/users/show.json") 
      .addParam("screen_name", "TwitterAPI") 
      //.setModelClass(Profile.class) 
      .getLoader(); 
  } 
 
  @Override 
  public void onLoadFinished(final Loader<ResponseData<Profile>> arg0, final ResponseData<Profile> arg1) {
    final Profile profile = arg1.getModel();