Dotted line is actually not dotted when app is running on real Android device

This is most likely related to hardware acceleration: Dashed lines are not supported in GL mode.

Its documented here: https://code.google.com/p/android/issues/detail?id=29944

Turn off your HW-acceleration in your AndroidManifest.xml like this:

android:hardwareAccelerated="false"

or:

myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null) 

For more information how to use first solution: http://developer.android.com/guide/topics/graphics/hardware-accel.html


I found a same solution but in View attributes (xml):

        <View
        android:layout_width="wrap_content"
        android:layout_height="4dp"
        ...
        android:layerType="software"/>

I suppose it's a View level as said above. Other variants for attribute ("none" and of course "hardware") didn't work for me.