Code example for ActionBar

Methods: getNavigationMode

0
	public void testState() { 
		MainActivity mainActivity = this.getActivity();
		ActionBar actionBar = mainActivity.getActionBar();
 
		// Check if the correct navigation mode is set 
		assertTrue(actionBar.getNavigationMode() == ActionBar.NAVIGATION_MODE_TABS);
	} 
 
	/** 
	 * Test if the tab switching functionality is functioning properly. 
	 */ 
	public void testSwitchTabs() { 
		MainActivity mainActivity = this.getActivity();
 
		// Get the id of the view pager handling the tabs 
		ViewPager viewPager = (ViewPager) mainActivity
				.findViewById(R.id.vPager); 
		int viewPagerId = viewPager.getId();
 
		solo.assertCurrentActivity("Current activity is not MainActivity",
				MainActivity.class);