Back to project page android-drawerlayout.
The source code is released under:
MIT License
If you think the Android project android-drawerlayout 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 com.tutecentral.navigationdrawer; // ww w. j a v a 2 s. c om import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; public class FragmentThree extends Fragment { ImageView ivIcon; TextView tvItemName; public static final String IMAGE_RESOURCE_ID = "iconResourceID"; public static final String ITEM_NAME = "itemName"; public FragmentThree() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_layout_three, container, false); ivIcon = (ImageView) view.findViewById(R.id.frag3_icon); tvItemName = (TextView) view.findViewById(R.id.frag3_text); tvItemName.setText(getArguments().getString(ITEM_NAME)); ivIcon.setImageDrawable(view.getResources().getDrawable( getArguments().getInt(IMAGE_RESOURCE_ID))); return view; } }