donnadulcinea
donnadulcinea

Reputation: 1874

View not painted in a particular case

Dear Stack Overflow Users,

I am exploiting the Vintage Thermometer Template of this example (source code downloadable) http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

The only part of code I modified is the parametrization of the background image and the scale. My trial app works fine, both in the emulators (A phone 4.0' Android 4.3) and a Tablet (7.0' Android 4.4.2), and my phones, a Galaxy S Plus, and a Galaxy S III.

Since the code seemed to work I moved the view to another project where I'm using the Thermometer as Speedometer. Here again, everything is fine, both in the emulators and my Galaxy S Plus..., but not in the Galaxy S III!

What does work and what doesn't: everything works but the method drawHand() apparently. The hand is not painted for some reason. And just in this new project just with the Galaxy S III.

Now, everything in the layout and the code seems OK. I can't find cross compatibility issues anywhere. What I am asking you is maybe a more general question: something like this can actually happen and why? I searched for days for some similar issue without finding anything.

The view is inflated in the same way:

<com.example.speedometer.Tachimetro
    android:id="@+id/tachimetro2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1.5" />

inside a linear layout.

The manifest has nothing except the call for the main activity. Galaxy S III is the only phone where something is not painted.

This is what I see, except in a Galaxy SIII where needle is not painted

That's weird. Any idea what could be my next step?

Upvotes: 3

Views: 258

Answers (2)

SQLiteNoob
SQLiteNoob

Reputation: 3022

Related solution to wthomas, instead of manually disabling hardware acceleration, in the mayou can target API 13 or less:

    <uses-sdk
    android:minSdkVersion="3"
    android:targetSdkVersion="13" />
  • it was after API 14 (4.0 Ice Cream Sandwich) that hardware acceleration became "automatic."

Upvotes: 1

wthomas
wthomas

Reputation: 36

Sorry for late response, but please try disabling hardware acceleration. One way to do that is to add the following to your manifest file:

<application android:hardwareAccelerated="false" ...>

Upvotes: 2

Related Questions