So, I'm going through the "Android Apps Development Tutorial for Beginners (3) - 2015" I've been following everything to the tee but at the very end when I launch my app the picture for some reason doesn't load in the app. I'm getting no error messages either.


activity_main.xml










top_section_fragment.xml














bottom_picture_fragment.xml


















MainActivity.java

package com.example.michaelhill.fragments;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends AppCompatActivity implements TopSectionFragment.TopSectionListener {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public void createMeme(String top, String bottom) {
BottomPictureFragment bottomFragment = (BottomPictureFragment) getSupportFragmentManager().findFragmentById(R.id.fragment2);
bottomFragment.setMemeText(top, bottom);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
}



TopSectionFragment.java

package com.example.michaelhill.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.app.Activity;
import android.widget.Button;
import android.widget.EditText;

public class TopSectionFragment extends Fragment{

private static EditText topTextInput;
private static EditText bottomTextInput;

TopSectionListener activityCommander;

public interface TopSectionListener{
public void createMeme(String top, String bottom);
}

@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try{
activityCommander = (TopSectionListener) activity;
}catch (ClassCastException e){
throw new ClassCastException(activity.toString());
}
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.top_section_fragment, container, false);

topTextInput = (EditText) view.findViewById(R.id.topTextInput);
bottomTextInput = (EditText) view.findViewById(R.id.bottomTextInput);
final Button button = (Button) view.findViewById(R.id.button);

button.setOnClickListener(
new View.OnClickListener() {
public void onClick(View v){
buttonClicked(v);
}
}
);

return view;
}

public void buttonClicked(View view){
activityCommander.createMeme(topTextInput.getText().toString(),bottomTextInput.getText().toString());
}}



BottomPictureFragment.java

package com.example.michaelhill.fragments;

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;
private static TextView bottomMemeText;

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

public void setMemeText(String top, String bottom){
topMemeText.setText(top);
bottomMemeText.setText(bottom);
}
}