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; /* w w w. ja va 2 s . c o m*/ 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 FragmentTwo extends Fragment { ImageView ivIcon; TextView tvItemName; public static final String IMAGE_RESOURCE_ID = "iconResourceID"; public static final String ITEM_NAME = "itemName"; public FragmentTwo() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view=inflater.inflate(R.layout.fragment_layout_two,container, false); ivIcon=(ImageView)view.findViewById(R.id.frag2_icon); tvItemName=(TextView)view.findViewById(R.id.frag2_text); tvItemName.setText(getArguments().getString(ITEM_NAME)); ivIcon.setImageDrawable(view.getResources().getDrawable( getArguments().getInt(IMAGE_RESOURCE_ID))); return view; } }