Android Question [SOLVED] Calling an activity by tapping on a widget

Discussion in 'Android Questions' started by rleiman, May 8, 2018.

  1. rleiman

    rleiman Well-Known Member Licensed User

    Hi Everyone,

    Can you tell me what coding I need to add to the widget service in order to call an activity when the user taps the widget?

    Thanks.
     
  2. Pendrush

    Pendrush Well-Known Member Licensed User

    For example (if panel name is Panel1):
    Code:
    Sub Panel1_Click
        
    StartActivity(Main) 'Main is name of activity you want to start, add name of your activity
    End Sub
    add this code in widget service.
     
  3. rleiman

    rleiman Well-Known Member Licensed User

    Hi Pendrush,

    I tried to right click in the designer to declare a Dim for the panel but instead got a message telling me "Current module does not support adding members". Looks like with widgets there must be a different way to do it.
     
  4. rleiman

    rleiman Well-Known Member Licensed User

    Hi Everyone,

    It turns out you I didn't need to declare a Dim for the panel. Just using the panel name like Pendrush stated was all I needed to do.

    Here's the code that worked:

    Code:
    Sub MyPanel_Click
        
    StartActivity(Main)
    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice