Question

I have an Activity that accepts voice input, instantiates a Card and then responds to an onClick event. When the onClick fires off, I want redirect the use back to the "OK Glass" view or the timeline containing a historical card representing that action. I can't seem to find any obvious way to do this...

Was it helpful?

Solution

In a live card, you can call:

finish();

to return to the home screen (OK Glass).

I tested this on XE16 and it worked.

Here is some more detailed code from my Activity:

    @Override 
public boolean onKeyDown(int keyCode, KeyEvent event) {

    switch (keyCode) {
        case KeyEvent.KEYCODE_DPAD_CENTER:
        {
                //return to OK Glass screen
            finish();
            return true;
        }
    }
    return super.onKeyDown(keyCode, event);
}

If you provide some code to make your question more specific I can provide more specific guidance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top