Question

I am using fragments in my application. There is scrollview in one of fragment containing many views. When user click on edittext, keyboard opens but when user click done button on keyboard then keyboard get hidden leaving black screen. I tried a lot my self but no luck. Please guide me..

Was it helpful?

Solution

Put this code in your AndroidManifest.xml file in your activity tag-

<activity
     android:name="com.example.YourActivity" 
     android:configChanges="keyboard|keyboardHidden|
                   orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
     android:windowSoftInputMode="stateHidden|adjustPan">
   </activity>

OTHER TIPS

Surly you are doing lot of things on UI thread.

do long running processes on other thread or Asynctask.

See this link, it will help you out.

http://developer.android.com/training/articles/perf-anr.html

View view = findViewById(R.id.root);
view.getRootView().setBackgroundColor(android.R.color.white)

The code above can fix this for some layouts but might be failed for others, you can try.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top