add方法报错的, 点了后退直接退了activity的。看看你是不是用了ActionBarActivity(老师是Activity)
如果是ActionBarActivity,要这样
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
android.support.v4.app.FragmentTransaction transaction = manager.beginTransaction();
MyFragment 继承 android.support.v4.app.Fragment
如果是ActionBarActivity,要这样
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
android.support.v4.app.FragmentTransaction transaction = manager.beginTransaction();
MyFragment 继承 android.support.v4.app.Fragment
2015-05-16
在action.move中做切页判断不是特别的恰当,因为action.move会随着手指的移动不断的执行,最好在其中做跟随手指的偏移动画,action.up中做切页或者回退动画!
2015-05-12