Android Question Webview and API level is >=14

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Hi Erel
Hi All

According to:
https://developer.android.com/guide/topics/graphics/hardware-accel.html

I have a problem with webview in many newer devices that doesn't display webview content! they display a white blank screen!

According to android doc url above, i should disable hardware acceleration, i want it done in activity level and in view level (i try in manifest file, it worked for the first activity, others no).

Activity Level:
B4X:
<application android:hardwareAccelerated="true">
    <activity ... />
    <activity android:hardwareAccelerated="false" />
</application>

View Level:
B4X:
myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);


Please convert these code to B4A .

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please avoid. This is a community forum.

I have a problem with webview in many newer devices that doesn't display webview content! they display a white blank screen!
Never encountered such issue.

You can use SetActivityAttribute(Main, android:hardwareAccelerated, "false") in the manifest editor.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
According to android doc url above, i should disable hardware acceleration, i want it done in activity level and in view level (i try in manifest file, it worked for the first activity, others no).

So learn how the manifest editor works and set the hardwareAccelerated attribute to false for other activties where required.
What have you added to the manifest editor so far?
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
<application android:hardwareAccelerated="false">
</application>)

SetActivityAttribute(Main, android:hardwareAccelerated, "false")
SetActivityAttribute(activitystore, android:hardwareAccelerated, "false")

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

Added, but only Main activity affected!, other activities not affected, still blank!

Any suggestion?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should set this attribute for any activity you like:
B4X:
SetActivityAttribute(Activity1, android:hardwareAccelerated, "false")
SetActivityAttribute(Activity2, android:hardwareAccelerated, "false")
SetActivityAttribute(Activity3, android:hardwareAccelerated, "false")
SetActivityAttribute(Activity4, android:hardwareAccelerated, "false")
 
Upvote 0
Top