Advertisement
Guest User

ChildFragment

a guest
Jul 9th, 2013
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package com.test.fragmentchildissue;
  2.  
  3. import android.os.Bundle;
  4. import android.support.v4.app.Fragment;
  5. import android.view.LayoutInflater;
  6. import android.view.View;
  7. import android.view.ViewGroup;
  8. import android.widget.TextView;
  9.  
  10. public class ChildFragment extends Fragment {
  11.    
  12.     @Override
  13.     public View onCreateView(LayoutInflater inflater, ViewGroup container,
  14.             Bundle savedInstanceState) {
  15.         View view = null;
  16.         try {
  17.             view = inflater.inflate(R.layout.layout_childfragment, container,
  18.                     false);
  19.  
  20.             Bundle bundle = getArguments();
  21.             final String text = bundle.getString("text");
  22.  
  23.             TextView textView = (TextView) view.findViewById(R.id.textView1);
  24.             textView.setText(text);
  25.  
  26.         } catch (Exception e) {
  27.             e.printStackTrace();
  28.         }
  29.         return view;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement