Question

I have a smartwatch 2 app on the market which has been working fine for months, but recently it has started crashing a second after the context menu is opened.

The onKey code looks like this:

@Override
public void onKey(final int action, final int keyCode, final long timeStamp) {
    // Menu button click
    if (action == Control.Intents.KEY_ACTION_RELEASE
            && keyCode == Control.KeyCodes.KEYCODE_OPTIONS) {
        showMenu(mMenuItemsText);
    }
}

(mMenuItemsText is defined at the class level and instantiated in the constructor:

    mMenuItemsText[0] = new Bundle();
    mMenuItemsText[0].putInt(Control.Intents.EXTRA_MENU_ITEM_ID, MENU_ITEM_REVERSE_RATE);
    mMenuItemsText[0].putString(Control.Intents.EXTRA_MENU_ITEM_TEXT, context.getResources().getString(R.string.converter_menu_reverse_rate));

)

When I click the watch menu button in my app, the menu opens up, and then a second later the watch crashes and disconnects from the phone before starting back up and reconnecting to the phone. Nothing in logcat and the phone doesn't show a crash prompt, it seems completely unaware that the watch has crashed.

If I put Log.d statements on each line above then they all show up in logcat, it seems to be happening after the menu has finished its "swipe in" animation.

Thinking the problem was in the utils app, I tried replacing the showMenu call with the same code to send the menu intent directly:

@Override
public void onKey(final int action, final int keyCode, final long timeStamp) {
    // Menu button click
    if (action == Control.Intents.KEY_ACTION_RELEASE
            && keyCode == Control.KeyCodes.KEYCODE_OPTIONS) {
        Intent intent = new Intent(Control.Intents.CONTROL_MENU_SHOW);
        intent.putExtra(Control.Intents.EXTRA_MENU_ITEMS, mMenuItemsText);
        sendToHostApp(intent);
    }
}

But I get the same problem. I have another SW2 app on the market with the same code and it works fine. I'm completely stumped as to how to find the problem, as I'm unable to step into the code in Eclipse.

Was it helpful?

Solution

This issue will be fixed in the upcoming 1.4.54 host app SW to be released in the next few days. The issue has to do with the number of touch regions supported, which has been increased from 25 to 30 in the update.

OTHER TIPS

I have about the same problem. I have several menus in my app but only one of them will crash the Smartwatch 2. It happens every time now, also reported by many users. The problem came after the recent firmware update. So hopefully it will be fixed in a new firmware or updated SDK release.

My problem is now fixed in latest firmware from Sony

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