@Override protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_ACTION_BAR); super.onCreate(savedInstanceState); setContentView(getContentView()); // Get the preferences file pref = getSharedPreferences(App.PREF_FILE_NAME, Context.MODE_PRIVATE); // //Get the core application class // app = App.instance();//(App) getApplicationContext(); // api = app.api; // // Set the drawer toggle as the DrawerListener getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.sb_action_bar)); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); mViewPager = (ViewPager) findViewById(R.id.promotions_viewpager); mViewPager.setAdapter(new PromotionsPagerAdapter(getSupportFragmentManager())); ((LockedViewPager) mViewPager).setLock(true); // mViewPager.setOffscreenPageLimit(2); setTitle(R.string.sb_promotions_title); }
public void onClickPromotion(View view) { mViewPager.setCurrentItem(1); ((LockedViewPager) mViewPager).setLock(false); }
@Override protected void onResume() { ((LockedViewPager) mViewPager).setLock(true); super.onResume(); }