Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.john.fragment;
- import android.os.Bundle;
- import android.support.v4.app.Fragment;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import android.widget.TextView;
- public class BottomPictureFragment extends Fragment {
- private static TextView topMemeText; //referenser
- private static TextView bottomMemeText;
- @Override //Samma kod som i topSectionfragement förutom själva fragmentets namn.
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.bottom_picture_fragment, container, false);
- topMemeText = (TextView) view.findViewById(R.id.topMemeText);
- bottomMemeText = (TextView) view.findViewById(R.id.bottomMemeText);
- return view;
- }
- //Tar emot två params(strängar) och sätter topMemeText och bottomMemeText
- //till det som skickas in av användaren.
- public void setMemeText(String top, String bottom){
- topMemeText.setText(top);
- bottomMemeText.setText(bottom);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement