getSupportFragmentManager cannot be resolved to type


#1

import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager;

I have the above imports and still cannot get rid of the error

in my code.
Here is my implementation:


#2

Howdy JohnWayne,

getSupportFragmentManager() is a method call, and I think the issue here is that you just need to remove the “new” keyword from the line you highlight and all will be well. Using “new” tells Java that you are trying to instantiate a new instance of a class, where in this case you’re just trying to call a method.


#3

Thanks brian! Somewhat “new” to java programming.


#4

I am having the same problem on my Mac. I removed the “new” but I’m still getting an error. How can I resolve the issue?


#5

phi1594, can you post your code? Maybe the problem is on some other line.