The full error is: "Unknown method 'executePendingTransactions' of 'android.support.v4.app.FragmentTransaction".
The detail is that I'm programming with AIDE.
I've imported the following packages (I've imported more, but these are the most relevant, I think):
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
Must I update a think? How can I solve this problem?
Unknown method 'executePendingTransactions' of 'android.support.v4.app.FragmentTransaction.
You should be calling executePendingTransactions
on the FragmentManager
not FragmentTransaction
.
FragmentManager mFragmentManager = getSupportFragmentManager();
FragmentTransaction mFragmentTransaction = mFragmentManager.beginTransaction();
Fragment fragment = mFragmentManager.findFragmentById(R.id.main_content);
mFragmentManager.executePendingTransactions();