开发者

Activity background becoming black! [duplicate]

This question already has answers here: Memory leak in WebView (9 answers) Closed 2 years ago.

i have set the background of an activity with a green gradient png image as

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    and开发者_如何学Pythonroid:layout_height="fill_parent"
    android:background="@drawable/bg"
    android:orientation="vertical">
...
</LinearLayout>

This working fine almost always but some times during navigating to an activity its background is becoming black! i am not able to reproduce it with any specific operation, also not getting how to debug or fix it.


Are you using a ListView? Try setting the android:cacheColorHint="#00000000" as described here.


Most likely you are not cleaning up/resuming your activity properly. We'll have to see your onPause and onResume, etc... of that activity to see what you are doing. This has nothing to do with the layout file.


Ashis I believe you are trying to perform a lot of operations on UI thread's lifecycle activities(onCreate,etc).So please post a snippet of your Activity's lifecycle methods

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜