Try replacing setVisible
with setIcon
. When doing that you need to prepare another drawable for icon with the same size as bus4.png
, but with all pixels transparent.
Note there is a bug related to setIcon
that causes info window to disappear.
As a side note a couple of problems in your code:
- Using
Timer
is wasteful. It usesThread
, which you don't need. Consider usingHandler
instead. - You (probably) have a memory leak.
Timer
will not stop working when theActivity
is destroyed. You need tocancel
it if you don't do that already. If switching toHandler
, rember to remove anyRunnable
s orMessage
s you send.