在今天的android学习中遇到这个问题replace报错,在已经全部用v4包,getSupportFragmentManager()的情况下,出现此问题,怀疑是v4包的兼容问题,故而getSupportFragmentManager()改为了getFragmentManager(). 贴上原总结网址 http://www.runoob.com/w3cnote/android-tutorial-fragment-base.html