Elad Benda
Elad Benda

Reputation: 36664

how to dismiss a static card in Google glass after X seconds?

I'm adding a static card to my google glass timeline.

How can I dismiss this card after 2 seconds?

Is it possible to delay-dismiss even if the activity which created this card has finished already?

Upvotes: 0

Views: 257

Answers (1)

swooby
swooby

Reputation: 3135

You should be able to use a combination of Handler.postDelayed(Runnable, long) and TimelineManager.delete(long)

Example:

mHandler.postDelayed(new Runnable() {
    public void run () {
        mTimelineManager.delete(cardId);
    }
}, 5000);

If you are using a Service then you can do this even after the Activity has finished.

Upvotes: 2

Related Questions