Android Open Source - android-drawerlayout Fragment Two






From Project

Back to project page android-drawerlayout.

License

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.

Java Source Code

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;
  }

}




Java Source Code List

com.example.android.navigationdrawerexample.MainActivity.java
com.example.drawersample.MainActivity.java
com.tutecentral.navigationdrawer.CustomDrawerAdapter.java
com.tutecentral.navigationdrawer.CustomDrawerAdapter.java
com.tutecentral.navigationdrawer.CustomSpinnerAdapter.java
com.tutecentral.navigationdrawer.DrawerItem.java
com.tutecentral.navigationdrawer.DrawerItem.java
com.tutecentral.navigationdrawer.FragmentOne.java
com.tutecentral.navigationdrawer.FragmentOne.java
com.tutecentral.navigationdrawer.FragmentThree.java
com.tutecentral.navigationdrawer.FragmentThree.java
com.tutecentral.navigationdrawer.FragmentTwo.java
com.tutecentral.navigationdrawer.FragmentTwo.java
com.tutecentral.navigationdrawer.MainActivity.java
com.tutecentral.navigationdrawer.MainActivity.java
com.tutecentral.navigationdrawer.SpinnerItem.java