Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Using ImageView in (onButtonSingleOrDoubleClickOrHold)

    Developers
    2
    2
    1524
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • abdullah.zaman
      abdullah.zaman last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • Emil
        Emil FlicTeam last edited by

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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post