Advertisement
Guest User

Untitled

a guest
May 4th, 2015
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. package com.example.john.fragment;
  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 BottomPictureFragment extends Fragment {
  11.  
  12.     private static TextView topMemeText; //referenser
  13.     private static TextView bottomMemeText;
  14.  
  15.  
  16.     @Override  //Samma kod som i topSectionfragement förutom själva fragmentets namn.
  17.     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  18.         View view = inflater.inflate(R.layout.bottom_picture_fragment, container, false);
  19.  
  20.         topMemeText = (TextView) view.findViewById(R.id.topMemeText);
  21.         bottomMemeText = (TextView) view.findViewById(R.id.bottomMemeText);
  22.         return view;
  23.     }
  24. //Tar emot två params(strängar) och sätter topMemeText och bottomMemeText
  25.     //till det som skickas in av användaren.
  26.  
  27.     public void setMemeText(String top, String bottom){
  28.  
  29.         topMemeText.setText(top);
  30.         bottomMemeText.setText(bottom);
  31.     }
  32.  
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement