Fragment toString - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment toString method.

This code example shows how to use the following methods:getActivity, getView, onResume, toString
    return result;
  } 
 
  @Override 
  public void onResume() { 
    super.onResume(); 
    getActivity().setTitle(toString());
    getView().setOnClickListener(new OnClickListener() {
      @Override 
      public void onClick(View v) {
        takePhoto(); 
      } 
    }); 
  } 
 
  @Override 
  public void onStop() { 
    super.onStop(); 
    ViewGroup layout = (ViewGroup) getActivity().findViewById(R.id.basic_camera_display_layout);
    if (layout != null) {
7
CodeRank
This code example shows how to use the following methods:getActivity, onResume, toString
    } 
  } 
 
  @Override 
  public void onResume() { 
    super.onResume(); 
    getActivity().setTitle(toString());
  } 
 
  /** 
   * Creates the controller (play, pause, rewind etc controls) for the player. 
   */ 
  private void createMediaController() { 
    checkState(mediaPlayer != null,
        "media player must be initialized before the media controller"); 
 
    mediaController = new MediaController(getActivity());
 
    mediaController.setAnchorView(getAudioView());
 
6
CodeRank
This code example shows how to use the following methods:toString
        final InsertQuickResponseDialog dialog = new InsertQuickResponseDialog();
 
        // If a target is set, it MUST implement Callback. Fail-fast if not. 
        if (callbackFragment != null) {
            if (!(callbackFragment instanceof Callback)) {
                throw new ClassCastException(callbackFragment.toString()
                        + " must implement Callback"); 
            } 
            dialog.setTargetFragment(callbackFragment, 0);
        } 
 
        Bundle args = new Bundle();
        args.putParcelable(ACCOUNT_KEY, account);
        dialog.setArguments(args);
        return dialog;
    } 
 
    @Override 
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        // If target not set, the parent activity MUST implement Callback. Fail-fast if not. 
5
CodeRank
This code example shows how to use the following methods:toString
	private static final String TAG = "MapFragment";
 
	// This needs some fixing for code cleanup 
	public static final String ARG_SECTION_NUMBER = "section_number";
 
	public ControllerMapFragment() { 
		if (D)
			Log.d(TAG, "Fragment: " + this.toString() + " Loaded");
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		Log.i(TAG, "++ onCreateView ++");
		View rootView = inflater.inflate(R.layout.frag_cont_map_view,
				container, false);
 
		return rootView;
	} 
} 
5
CodeRank
This code example shows how to use the following methods:setArguments, toString
    static FirstFragment newInstance(String url) {
        Log.d(TAG, "FirstFragment Enter newInstance");
        FirstFragment f = new FirstFragment();
        Bundle b = new Bundle();
        b.putString("url", url);
        f.setArguments(b);
        Log.d(TAG, "FirstFragment Exit  newInstance f = " + f.toString());
        return f;
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle savedInstanceState) {
        Log.d(TAG, "FirstFragment Enter onSaveInstanceState");
        super.onSaveInstanceState(savedInstanceState);
        String lasturl = mWebview.getUrl();
        savedInstanceState.putString("url", lasturl);
        Log.d(TAG, "FirstFragment Exit  onSaveInstanceState");
    } 
 
    @Override 
4
CodeRank
This code example shows how to use the following methods:setArguments, toString
    static SecondFragment newInstance(String url) {
        Log.i(TAG, "SecondFragment Enter newInstance");
        SecondFragment f = new SecondFragment();
        Bundle b = new Bundle();
        b.putString("url", url);
        f.setArguments(b);
        Log.i(TAG, "SecondFragment Exit  newInstance f = " + f.toString());
        return f;
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle savedInstanceState) {
        Log.i(TAG, "SecondFragment Enter onSaveInstanceState");
        super.onSaveInstanceState(savedInstanceState);
        String lasturl = mWebview.getUrl();
        savedInstanceState.putString("url", lasturl);
        Log.i(TAG, "SecondFragment Exit  onSaveInstanceState");
    } 
 
    @Override 
4
CodeRank

Related Fragment toString Questions & Answers:

toString Method Overview
Returns a string containing a concise, human-readable description of this object.
See Code Examples for other Android Fragment Methods: