3

enter image description here

hi, I am loading more than 500 items in a listview from a Web API. Each list item contains one imageview and two text views. But while loading these huge items, when we rotate the screen, a portion of the screen will become black as shown in the figure and after 10 or 20 seconds it will be okay. It is happening in almost all android devices like samsung duos and nexus 9 tablet I am sure that nothing is blocking the UI main thread. SO please suggest a solution to this problem

Sandeep
  • 51
  • 1
  • 5

2 Answers2

0

This happens due to the view being reloaded into memory. In Android it is possible to have different layouts for each orientation. That is why the view needs to be reloaded and if there are many many elements as in your case this becomes visible.

There are several solutions. You basically need to tell Android that you will handle orientation changes yourself. Please check the amswer here: Don't reload application when orientation changes

Community
  • 1
  • 1
Niki van Stein
  • 10,564
  • 3
  • 29
  • 62
0

You can remove this black screen space by making your layout to alignparentRight and alignparentLeft to TRUE.

KishuDroid
  • 5,411
  • 4
  • 30
  • 47