Using ImageView in (onButtonSingleOrDoubleClickOrHold)

  • I am trying to change my ImageView color e.g (from blue to black) on the event SingleClick in the method (onButtonSingleOrDoubleClickOrHold) in BroadCast Receiver but since 'findViewbyid' cant be used in non activity class it crashes my app. I tried to use Class constructor and alsosing Main activity object (bad option) and it crashes my app aswell.
    Is their anyway how I can use findViewbyId in (onButtonSingleOrDoubleClickOrHold) on the event SingleClick.

  • FlicTeam

    You could for example send an Intent to your activity. If it does not exist (due to inactivity) it will then be recreated.

Log in to reply