Click here to Skip to main content
14,765,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends. I am new to Android Development. I implemented an option in my android app for switching between FULL SCREEN and Normal Screen. Below is my code to do that. But I have experience one problem. When I Switch my app to Full Screen mode, all SCROLL VIEWS on my activity stops scrolling. And when I switch back to normal screen all Scroll Views work fine. Help me.

//Shared Preferences
		SharedPreferences screenPreference = getSharedPreferences("MyAppSettings", MODE_PRIVATE);
		int ScreenFlag = screenPreference.getInt("ScreenFlag", 0);
		SharedPreferences.Editor editor = screenPreference.edit();
		switch(ScreenFlag)
		{
		case 0:		//set preference ScreenFlag, app running first time
		case 2:		//Full screen - OFF
			getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
	        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
			editor.putInt("ScreenFlag", 2);
			editor.commit();
			break;
		case 1:		//Full screen - ONN
			getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
	        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
			editor.putInt("ScreenFlag", 1);
			editor.commit();
			break;
		default:
			break;
		}
		setContentView(R.layout.activity_main);
		//end - Shared Preferences
Posted
Updated 9-Jul-13 0:36am
v3
Comments
Ahmed Bensaid 9-Jul-13 5:41am
   
Hello. Do you use a ListView into your ScrollView ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900