List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_SENSOR_PORTRAIT
int SCREEN_ORIENTATION_SENSOR_PORTRAIT
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_SENSOR_PORTRAIT.
Click Source Link
sensorPortrait
in the android.R.attr#screenOrientation attribute. From source file:org.apache.cordova.screenorientation.ScreenOrientation.java
public int getOrientation(String orientation) { if (orientation.equals(UNSPECIFIED)) { return (ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else if (orientation.equals(LANDSCAPE)) { return (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else if (orientation.equals(PORTRAIT)) { return (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else if (orientation.equals(USER)) { return (ActivityInfo.SCREEN_ORIENTATION_USER); } else if (orientation.equals(BEHIND)) { return (ActivityInfo.SCREEN_ORIENTATION_BEHIND); } else if (orientation.equals(SENSOR)) { return (ActivityInfo.SCREEN_ORIENTATION_SENSOR); } else if (orientation.equals(NOSENSOR)) { return (ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); } else if (orientation.equals(SENSOR_LANDSCAPE)) { return (ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } else if (orientation.equals(SENSOR_PORTRAIT)) { return (ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } else if (orientation.equals(REVERSE_LANDSCAPE)) { return (ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } else if (orientation.equals(REVERSE_PORTRAIT)) { return (ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); } else if (orientation.equals(FULL_SENSOR)) { return (ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR); }/*w w w. j av a 2 s.co m*/ return (ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); }
From source file:htw.bui.openreskit.discard.InspectionActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mOverlayFramelayout = new FrameLayout(this); setContentView(mOverlayFramelayout); View view = getLayoutInflater().inflate(R.layout.inspection_fragment, mOverlayFramelayout, false); mOverlayFramelayout.addView(view);//from w w w . j a v a2 s . c om mContext = this; mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext); mHelpView = getLayoutInflater().inflate(R.layout.help_overlay, mOverlayFramelayout, false); mInspFrag = (InspectionFragment) mFragMan.findFragmentById(R.id.inspection_fragment); mAddInspectionButton = (Button) mOverlayFramelayout.findViewById(R.id.addInspectionButton); mAddInspectionButton.setOnClickListener(mButtonListener); if (Utils.isTablet(this)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); if (findViewById(R.id.inspectionLayoutContainer) != null) { // if we are being restored from a previous state, then we dont need to do anything and should // return or else we could end up with overlapping fragments. if (savedInstanceState != null) return; // Create an instance of inspectionInfoFragment mInspectionInfoFragment = new InspectionInfoFragment(); // Create an instance of RunningInspectionFragment mRunningInspectionFragment = new RunningInspectionFragment(); // add fragment to the fragment container layout FragmentTransaction ft = mFragMan.beginTransaction(); ft.add(R.id.inspectionFrameLayout, mInspectionInfoFragment); ft.hide(mInspectionInfoFragment).commit(); FragmentTransaction ft1 = mFragMan.beginTransaction(); ft1.add(R.id.inspectionFrameLayout, mRunningInspectionFragment); ft1.hide(mRunningInspectionFragment).commit(); } } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } ActionBar bar = getActionBar(); bar.setDisplayOptions( ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE); bar.setDisplayShowHomeEnabled(true); }
From source file:com.klinker.android.twitter.activities.tweet_viewer.TweetPager.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(R.anim.activity_slide_up, R.anim.activity_slide_down); try {//from w w w . j a v a 2 s . co m getWindow().requestFeature(Window.FEATURE_PROGRESS); } catch (Exception e) { } context = this; settings = AppSettings.getInstance(this); try { ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Ignore } getFromIntent(); mSectionsPagerAdapter = new TweetPagerAdapter(getFragmentManager(), context, name, screenName, tweet, time, retweeter, webpage, proPic, tweetId, picture, users, hashtags, otherLinks, isMyTweet, isMyRetweet, secondAcc, animatedGif); // methods for advancing windowed boolean settingsVal = settings.advanceWindowed; boolean fromWidget = getIntent().getBooleanExtra("from_widget", false); final boolean youtube; youtube = mSectionsPagerAdapter.getHasYoutube() || mSectionsPagerAdapter.getHasGif() || mSectionsPagerAdapter.hasVine(); if (fromWidget || settingsVal) { setUpWindow(youtube); } setUpTheme(); int currentOrientation = getResources().getConfiguration().orientation; if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } if (getIntent().getBooleanExtra("clicked_youtube", false)) { IntentFilter i = new IntentFilter("com.klinker.android.twitter.YOUTUBE_READY"); registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { TweetYouTubeFragment.resume(); context.unregisterReceiver(this); } }, i); } setContentView(R.layout.tweet_pager); pager = (ViewPager) findViewById(R.id.pager); pager.setAdapter(mSectionsPagerAdapter); pager.setOffscreenPageLimit(5); final int numberOfPages = mSectionsPagerAdapter.getCount(); pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int i, float v, int i2) { } @Override public void onPageSelected(int i) { if (youtube) { try { switch (numberOfPages) { case 3: case 4: if (i != 0) { TweetYouTubeFragment.pause(); } else { TweetYouTubeFragment.resume(); } break; case 5: if (i != 1) { TweetYouTubeFragment.pause(); } else { TweetYouTubeFragment.resume(); } break; } } catch (Exception e) { } } } @Override public void onPageScrollStateChanged(int i) { } }); switch (numberOfPages) { case 2: if (settings.pageToOpen == AppSettings.PAGE_CONVO) { pager.setCurrentItem(1); } else { pager.setCurrentItem(0); } break; case 3: if (mSectionsPagerAdapter.getHasWebpage()) { switch (settings.pageToOpen) { case AppSettings.PAGE_CONVO: pager.setCurrentItem(2); break; case AppSettings.PAGE_WEB: pager.setCurrentItem(0); break; default: pager.setCurrentItem(1); break; } } else { // no web page switch (settings.pageToOpen) { case AppSettings.PAGE_CONVO: pager.setCurrentItem(2); break; default: pager.setCurrentItem(1); break; } } break; case 4: // webpage and youtube switch (settings.pageToOpen) { case AppSettings.PAGE_CONVO: pager.setCurrentItem(3); break; case AppSettings.PAGE_WEB: pager.setCurrentItem(1); break; default: pager.setCurrentItem(0); break; } break; } if (getIntent().getBooleanExtra("clicked_youtube", false)) { pager.setCurrentItem(0); } if (settings.addonTheme) { PagerTitleStrip strip = (PagerTitleStrip) findViewById(R.id.pager_title_strip); strip.setBackgroundColor(settings.pagerTitleInt); if (!settings.showTitleStrip) { strip.setVisibility(View.GONE); } } }
From source file:com.klinker.android.twitter.ui.tweet_viewer.TweetPager.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(R.anim.activity_slide_up, R.anim.activity_slide_down); try {//from w ww .ja v a 2 s.co m getWindow().requestFeature(Window.FEATURE_PROGRESS); } catch (Exception e) { } context = this; settings = AppSettings.getInstance(this); try { ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Ignore } getFromIntent(); // methods for advancing windowed boolean settingsVal = settings.advanceWindowed; boolean fromWidget = getIntent().getBooleanExtra("from_widget", false); final boolean youtube; if (webpage != null && linkString != null) { youtube = webpage.contains("youtu") || linkString.contains("youtu"); } else { youtube = true; } // cases: (youtube will ALWAYS be full screen...) // from widget // the user set the preference to advance windowed // has a webview and want to advance windowed if (fromWidget || settingsVal) { setUpWindow(youtube); } setUpTheme(); int currentOrientation = getResources().getConfiguration().orientation; if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } if (getIntent().getBooleanExtra("clicked_youtube", false)) { IntentFilter i = new IntentFilter("com.klinker.android.twitter.YOUTUBE_READY"); registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { TweetYouTubeFragment.resume(); context.unregisterReceiver(this); } }, i); } setContentView(R.layout.tweet_pager); pager = (ViewPager) findViewById(R.id.pager); mSectionsPagerAdapter = new TweetPagerAdapter(getFragmentManager(), context, name, screenName, tweet, time, retweeter, webpage, proPic, tweetId, picture, users, hashtags, otherLinks, isMyTweet, isMyRetweet); pager.setAdapter(mSectionsPagerAdapter); pager.setOffscreenPageLimit(5); final int numberOfPages = mSectionsPagerAdapter.getCount(); pager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int i, float v, int i2) { } @Override public void onPageSelected(int i) { if (youtube) { try { switch (numberOfPages) { case 3: case 4: if (i != 0) { TweetYouTubeFragment.pause(); } else { TweetYouTubeFragment.resume(); } break; case 5: if (i != 1) { TweetYouTubeFragment.pause(); } else { TweetYouTubeFragment.resume(); } break; } } catch (Exception e) { } } } @Override public void onPageScrollStateChanged(int i) { } }); switch (numberOfPages) { case 2: if (settings.pageToOpen == AppSettings.PAGE_CONVO) { pager.setCurrentItem(1); } else { pager.setCurrentItem(0); } break; case 3: if (mSectionsPagerAdapter.getHasWebpage()) { switch (settings.pageToOpen) { case AppSettings.PAGE_CONVO: pager.setCurrentItem(2); break; case AppSettings.PAGE_WEB: pager.setCurrentItem(0); break; default: pager.setCurrentItem(1); break; } } else { // no web page switch (settings.pageToOpen) { case AppSettings.PAGE_CONVO: pager.setCurrentItem(2); break; default: pager.setCurrentItem(1); break; } } break; case 4: // webpage and youtube switch (settings.pageToOpen) { case AppSettings.PAGE_CONVO: pager.setCurrentItem(3); break; case AppSettings.PAGE_WEB: pager.setCurrentItem(1); break; default: pager.setCurrentItem(0); break; } break; } if (getIntent().getBooleanExtra("clicked_youtube", false)) { pager.setCurrentItem(0); } if (settings.addonTheme) { PagerTitleStrip strip = (PagerTitleStrip) findViewById(R.id.pager_title_strip); strip.setBackgroundColor(settings.pagerTitleInt); if (!settings.showTitleStrip) { strip.setVisibility(View.GONE); } } }
From source file:com.klinker.android.twitter.activities.profile_viewer.ProfilePager.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(R.anim.activity_slide_up, R.anim.activity_slide_down); mCache = App.getInstance(this).getBitmapCache(); context = this; sharedPrefs = context.getSharedPreferences("com.klinker.android.twitter_world_preferences", 0); settings = AppSettings.getInstance(this); try {/*from www. j a va 2s .c o m*/ ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Ignore } if (getIntent().getBooleanExtra("from_widget", false) || ((settings.advanceWindowed && !getIntent().getBooleanExtra("long_click", false)) || !settings.advanceWindowed && getIntent().getBooleanExtra("long_click", false))) { setUpWindow(); } setUpTheme(); int currentOrientation = getResources().getConfiguration().orientation; if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } getFromIntent(); setContentView(R.layout.tweet_pager); ViewPager pager = (ViewPager) findViewById(R.id.pager); ProfilePagerAdapter mPagerAdapter = new ProfilePagerAdapter(getFragmentManager(), context, name, screenName, proPic, tweetId, isRetweet, isMyProfile); pager.setAdapter(mPagerAdapter); pager.setOffscreenPageLimit(3); if (settings.addonTheme) { PagerTitleStrip strip = (PagerTitleStrip) findViewById(R.id.pager_title_strip); strip.setBackgroundColor(settings.pagerTitleInt); if (!settings.showTitleStrip) { strip.setVisibility(View.GONE); } } Utils.setActionBar(context, !settings.advanceWindowed); // set it to the profile pager.setCurrentItem(1); }
From source file:free.rm.skytube.gui.activities.YouTubePlayerActivity.java
@Override protected void onStart() { super.onStart(); // set the video player's orientation as what the user wants String str = SkyTubeApp.getPreferenceManager().getString(getString(R.string.pref_key_screen_orientation), getString(R.string.pref_screen_auto_value)); int orientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; if (str.equals(getString(R.string.pref_screen_landscape_value))) orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE; if (str.equals(getString(R.string.pref_screen_portrait_value))) orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT; if (str.equals(getString(R.string.pref_screen_sensor_value))) orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; setRequestedOrientation(orientation); }
From source file:nz.ac.otago.psyanlab.common.designer.program.stage.StageActivity.java
@Override public void refreshStage() { if (mOrientation == Scene.ORIENTATION_PORTRAIT) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } else {// w w w . j av a2 s . c o m setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } }
From source file:com.klinker.android.twitter.ui.profile_viewer.ProfilePager.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); overridePendingTransition(R.anim.activity_slide_up, R.anim.activity_slide_down); mCache = App.getInstance(this).getBitmapCache(); context = this; sharedPrefs = context.getSharedPreferences("com.klinker.android.twitter_world_preferences", Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE); settings = AppSettings.getInstance(this); try {// www. j av a 2 s. c om ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Ignore } if (getIntent().getBooleanExtra("from_widget", false) || ((settings.advanceWindowed && !getIntent().getBooleanExtra("long_click", false)) || !settings.advanceWindowed && getIntent().getBooleanExtra("long_click", false))) { setUpWindow(); } setUpTheme(); int currentOrientation = getResources().getConfiguration().orientation; if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } getFromIntent(); setContentView(R.layout.tweet_pager); ViewPager pager = (ViewPager) findViewById(R.id.pager); ProfilePagerAdapter mPagerAdapter = new ProfilePagerAdapter(getFragmentManager(), context, name, screenName, proPic, tweetId, isRetweet, isMyProfile); pager.setAdapter(mPagerAdapter); pager.setOffscreenPageLimit(3); if (settings.addonTheme) { PagerTitleStrip strip = (PagerTitleStrip) findViewById(R.id.pager_title_strip); strip.setBackgroundColor(settings.pagerTitleInt); if (!settings.showTitleStrip) { strip.setVisibility(View.GONE); } } Utils.setActionBar(context, !settings.advanceWindowed); // set it to the profile pager.setCurrentItem(1); }
From source file:zxing.util.CaptureActivity.java
License:asdf
@Override protected void onResume() { super.onResume(); // CameraManager must be initialized here, not in onCreate(). This is // necessary because we don't // want to open the camera driver and measure the screen size if we're // going to show the help on // first launch. That led to bugs where the scanning rectangle was the // wrong size and partially // off screen. cameraManager = new CameraManager(getApplication()); viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view); viewfinderView.setCameraManager(cameraManager); resultView = findViewById(R.id.result_view); statusView = (TextView) findViewById(R.id.status_view); handler = null;/* w ww .j av a 2 s . c o m*/ // lastResult = null; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); if (prefs.getBoolean(PreferencesActivity.KEY_DISABLE_AUTO_ORIENTATION, true)) { setRequestedOrientation(getCurrentOrientation()); } else { // setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } resetStatusView(); SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view); SurfaceHolder surfaceHolder = surfaceView.getHolder(); if (hasSurface) { // The activity was paused but not stopped, so the surface still // exists. Therefore // surfaceCreated() won't be called, so init the camera here. initCamera(surfaceHolder); } else { // Install the callback and wait for surfaceCreated() to init the // camera. surfaceHolder.addCallback(this); } beepManager.updatePrefs(); ambientLightManager.start(cameraManager); inactivityTimer.onResume(); Intent intent = getIntent(); decodeFormats = null; characterSet = null; if (intent != null) { //String action = intent.getAction(); //String dataString = intent.getDataString(); //characterSet = intent.getStringExtra(Intents.Scan.CHARACTER_SET); } }
From source file:net.abcdroid.devfest12.ui.SessionLivestreamActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { if (UIUtils.hasICS()) { // We can't use this mode on HC as compatible ActionBar doesn't work well with the YT // player in full screen mode (no overlays allowed). requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); }/*from w ww. j a v a2 s . c om*/ super.onCreate(savedInstanceState); YouTube.initialize(this, Config.YOUTUBE_API_KEY); setContentView(R.layout.activity_session_livestream); mIsTablet = UIUtils.isHoneycombTablet(this); // Set up YouTube player mYouTubePlayer = (YouTubePlayerSupportFragment) getSupportFragmentManager() .findFragmentById(R.id.livestream_player); mYouTubePlayer.enableCustomFullscreen(this); mYouTubePlayer.setOnPlaybackEventsListener(this); int fullscreenControlFlags = YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI | YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION; if (!mIsTablet) { fullscreenControlFlags |= YouTubePlayer.FULLSCREEN_FLAG_FULLSCREEN_WHEN_DEVICE_LANDSCAPE; setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } mYouTubePlayer.setFullscreenControlFlags(fullscreenControlFlags); // Views that are common over all layouts mMainLayout = (LinearLayout) findViewById(R.id.livestream_mainlayout); adjustMainLayoutForActionBar(); mPlayerContainer = (LinearLayout) findViewById(R.id.livestream_player_container); mFullscreenCaptions = (FrameLayout) findViewById(R.id.fullscreen_captions); final LayoutParams params = (LayoutParams) mFullscreenCaptions.getLayoutParams(); params.setMargins(0, getActionBarHeightPx(), 0, getActionBarHeightPx()); mFullscreenCaptions.setLayoutParams(params); ViewPager viewPager = (ViewPager) findViewById(R.id.pager); viewPager.setOffscreenPageLimit(2); viewPager.setPageMarginDrawable(R.drawable.grey_border_inset_lr); viewPager.setPageMargin(getResources().getDimensionPixelSize(R.dimen.page_margin_width)); // Set up tabs w/viewpager mTabHost = (TabHost) findViewById(android.R.id.tabhost); mTabHost.setup(); mTabsAdapter = new TabsAdapter(this, mTabHost, viewPager); if (mIsTablet) { // Tablet UI specific views getSupportFragmentManager().beginTransaction() .add(R.id.livestream_summary, new SessionSummaryFragment(), TAG_SESSION_SUMMARY).commit(); mVideoLayout = (LinearLayout) findViewById(R.id.livestream_videolayout); mExtraLayout = (LinearLayout) findViewById(R.id.livestream_extralayout); mSummaryLayout = (FrameLayout) findViewById(R.id.livestream_summary); } else { // Handset UI specific views mTabsAdapter.addTab(getString(R.string.session_livestream_info), new SessionSummaryFragment(), TABNUM_SESSION_SUMMARY); } mTabsAdapter.addTab(getString(R.string.title_stream), new SocialStreamFragment(), TABNUM_SOCIAL_STREAM); mTabsAdapter.addTab(getString(R.string.session_livestream_captions), new SessionLiveCaptionsFragment(), TABNUM_LIVE_CAPTIONS); if (savedInstanceState != null) { mTabHost.setCurrentTabByTag(savedInstanceState.getString(EXTRA_TAB_STATE)); } // Reload all other data in this activity reloadFromIntent(getIntent()); // Update layout based on current configuration updateLayout(getResources().getConfiguration()); // Set up action bar if (!mLoadFromExtras) { // Start sessions query to populate action bar navigation spinner getSupportLoaderManager().initLoader(SessionsQuery._TOKEN, null, this); // Set up action bar mLivestreamAdapter = new LivestreamAdapter(this); final ActionBar actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(mLivestreamAdapter, this); actionBar.setDisplayShowTitleEnabled(false); } }