Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. package pc.dd.tabhost;
  2.  
  3. import android.os.Bundle;
  4. import android.support.annotation.Nullable;
  5. import android.support.v4.app.Fragment;
  6. import android.support.v4.view.ViewPager;
  7. import android.support.v7.widget.CardView;
  8. import android.support.v7.widget.LinearLayoutCompat;
  9. import android.view.LayoutInflater;
  10. import android.view.View;
  11. import android.view.ViewGroup;
  12. import android.widget.Button;
  13. import android.widget.ImageView;
  14. import android.widget.LinearLayout;
  15. import android.widget.RelativeLayout;
  16. import android.widget.TextView;
  17.  
  18. import org.w3c.dom.Text;
  19.  
  20. public class TabFragment1 extends Fragment {
  21.  
  22. private View view;
  23.  
  24. public TextView textView;
  25.  
  26. public static Fragment newInstance(){
  27. TabFragment1 myFrag = new TabFragment1();
  28. return myFrag;
  29. }
  30.  
  31. @Override
  32. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  33. view =
  34. inflater.inflate(R.layout.tab_fragment_1, container, false);
  35. //RelativeLayout _relativeLeyout =(RelativeLayout) view.findViewById(R.id.tab_fragment_1);
  36. CardView _cardView = (CardView) view.findViewById(R.id.cardView);
  37. LayoutInflater inflaters = LayoutInflater.from(view.getContext());
  38. RelativeLayout layout = (RelativeLayout) inflaters.inflate(R.layout.cardwiev_posts, null, false);
  39.  
  40. RelativeLayout linear = (RelativeLayout)view.findViewById(R.id.tab_fragment_1);
  41. textView = (TextView) layout.findViewById(R.id.cardView_text);
  42. linear.addView(layout);
  43.  
  44.  
  45. return view;
  46. }
  47.  
  48. @Override
  49. public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  50. super.onViewCreated(view, savedInstanceState);
  51. //addCardview
  52.  
  53. //addCardView
  54.  
  55. }
  56.  
  57. public void updateTextView (String text){
  58. textView.setText(text);
  59. }
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement