Back to project page Navigation-drawer-a-la-Google.
The source code is released under:
Apache License
If you think the Android project Navigation-drawer-a-la-Google listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package info.korzeniowski.activitydrawersample; /* w w w . j a va 2 s.c o m*/ import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; public class SimpleFragment extends Fragment { private static final String ARG_TEXT = "text"; public static Fragment newInstance(String text) { SimpleFragment fragment = new SimpleFragment(); Bundle args = new Bundle(); args.putString(ARG_TEXT, text); fragment.setArguments(args); return fragment; } @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { ViewGroup view = new LinearLayout(getActivity()); TextView child = new TextView(getActivity()); child.setText(getArguments().getString(ARG_TEXT)); view.addView(child); return view; } }