Search code examples
androidgoogle-glassgoogle-gdk

proper way to present a cardScrollActivity before a live card for google glass


What is the proper way to present a card scroll activity before presenting a service? For example, if I wanted to allow the user to select a song in a scroll view before playing the song in a live card.


Solution

  • For this case I would still have the service be the entry point and use the following to start the scroll activity from the service (depending on the use case);

    Intent intent = new Intent(getBaseContext(), CardScrollActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    getApplication().startActivity(intent);
    

    Then after making your selection and before finishing your activity, using a service interface method publish your live card from the service or use a broadcast receiver to notify the service to publish.