Code example for PackageManager

Methods: getActivityInfo

0
				.getResources().getConfiguration().orientation);
 
		/// Method 2: Retrieve info about Activity as collected from AndroidManifest.xml 
		// https://developer.android.com/reference/android/content/pm/ActivityInfo.html 
		PackageManager packageManager = currentActivity.getPackageManager();
		ActivityInfo activityInfo = packageManager.getActivityInfo(currentActivity.getComponentName(),
				PackageManager.GET_ACTIVITIES);
 
		// Note that the activity is _indeed_ rotated on your device/emulator! 
		// Robotium can _force_ the activity to be in landscape mode (and so could we, programmatically) 
		solo.setActivityOrientation(Solo.LANDSCAPE); 
		solo.sleep(200); 
 
		assertEquals(ScriptActivity.class.getSimpleName() + " not set to be in portrait mode in AndroidManifest.xml!",
				ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, activityInfo.screenOrientation);
	} 
 
	public void testMainMenuButton() { 
		UiTestUtils.waitForFragment(solo, R.id.fragment_script); 
 
Connect your IDE to all the code out there  Get Codota for Java