I'm trying to set up a log in system for an app, and I've been following along with this video series. Basically I understand the general concept of what's going on, but not why he's doing what he's doing sometimes. Anyways, I get some errors with the lines that say
final FragmentManager fm = getActivity().getSupportFragmentManager();
fm.beginTransaction().replace(R.id.content, new LoginFragment()).commit();
The errors say
Can't resolve method 'getActivity()'
on that first line, even though I've seen it in the documentation, and
Wrong 2nd argument type. Found: 'your.project.structure.LoginFragment', required: 'android.support.v4.app.Fragment'
on the second line where I have new LoginFragment()
After hours of googling, trying things and reading documentation, I still have no idea what I'm doing, and I end up going in circles. I also have no idea if I'm even giving enough information, so ask away and I'll do my best to respond accurately.