'Activity goes blank black after sometime

I don't understand why my app goes black after few seconds in android 11. This same app works well without producing this problem in android 8.1

This is the error once the problem occur

  E/IMGSRV: :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
I/OpenGLRenderer: Davey! duration=1175ms; Flags=1, IntendedVsync=219419704342806, Vsync=219420754692918, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=219420758757692, AnimationStart=219420758776999, PerformTraversalsStart=219420772291307, DrawStart=219420871060076, SyncQueued=219420877282384, SyncStart=219420881147153, IssueDrawCommandsStart=219420881302769, SwapBuffers=219420882651692, FrameCompleted=219420883906999, DequeueBufferDuration=0, QueueBufferDuration=952692, GpuCompleted=0, 
E/IMGSRV: :3061: Start Frame failed
    :5001: glDrawArrays: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed
    :5416: DrawElements: Can't prepare to draw
    :3061: Start Frame failed

My app is a simple downloader use for downloading files such as image, video, html and more. it makes use of webview to load html source code returned from a httpurlconnection, it loads the source in webview in other to extract links to other pages from the html source code.

This is just a simple way my app works.

My java source code is much and i don't know which part to share with you guys.

 <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="false"
        android:icon="@mipmap/icon"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/icon"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true">

This my gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.downloader.loadervx"
        minSdkVersion 26
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
   // implementation 'org.jsoup:jsoup:1.14.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation files('libs\\jsoup-1.14.3.jar')
}

I have google it out but can't find anything helpful



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source