/** get the touch event and call onMone on the active fragment */ @Override public boolean dispatchTouchEvent(MotionEvent ev) { int item = mPager.getCurrentItem(); WindFragment tf = (WindFragment) mFragmentAdapter.getItem(item); if (tf != null) { tf.onMove(ev); } return super.dispatchTouchEvent(ev); }
public void openHistory() { Context context = getApplicationContext(); Intent intent = new Intent(context, HistoryActivity.class); int item = mPager.getCurrentItem(); WindFragment tf = (WindFragment) mFragmentAdapter.getItem(item); if (tf != null) { intent.putExtra(Const.EXTRA_INTENTINFO_SPOTID, tf.getSpotID()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); } }