in my app I use XML defined vertical dotted line.
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.
Controlling Hardware Acceleration
You can control hardware acceleration at the following levels:
Application
Activity
Window
View
Application level
<application android:hardwareAccelerated="true" ...>
Activity level
<application android:hardwareAccelerated="true">
<activity ... />
<activity android:hardwareAccelerated="false" />
</application>
Window level
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
View level
myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Reference
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