MemeCreator stuck on last step

0 Superman HC · October 24, 2015
So I have followed all the videos of bucky on meme creator for hours... and now when I am one step away it's showing error

package com.example.app4;

import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity implements TopSectionFragment.TopSectionListener{

    protected void onCreate(Bundle savedInstanceState) {
// Gets called by topsectionfragment when button is clicked
public void createMeme(String top, String bottom) {
// TODO Auto-generated method stub
bottom_section_fragment bottomFragment = (bottom_section_fragment) getSupportFragmentManager().findFragmentById(;

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

It said the method getSupportFragmentManager() is undefined for the main activity... 
I have looked up for this on net and try to implement fragment activity and do it with getFragmentManager but in vain..

Please suggest something !!!

Post a Reply


Oldest  Newest  Rating
0 Amir Fahd Hadji Usop · October 26, 2015
That is because I suspect that you are importing the wrong library:

Instead of using,


try using,


0 Superman HC · October 25, 2015
thanks for your valuable comment... the minimum api i am using is froyo...
and the code doesn't support so i used and it only supports extending Activity.
0 Gary Whitney · October 24, 2015
The code looks right.
Fragments weren't supported until Honeycomb so I am wondering what your min API is.
But then I notice you are extending Activity and not ActionBarActivity which requires import;

The key to your problem is Activity does not have a getSupportFragmentManager() method it has a getFragmentManager() method.
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator