com.google.android.gms.wearable.WearableListenerService Java Examples

The following examples show how to use com.google.android.gms.wearable.WearableListenerService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Tasks.java    From sensordatacollector with GNU General Public License v2.0 5 votes vote down vote up
static void startWearableApp(WearableListenerService wls)
{
    MainActivity ma = (MainActivity) ActivityController.getInstance().get("MainActivity");

    if(ma != null && BluetoothAdapter.getDefaultAdapter() != null) {
        BroadcastService.getInstance().sendMessage("/activity/started", DeviceID.get(ma) + "~#X*X#~" + BluetoothAdapter.getDefaultAdapter().getAddress());
        return;
    }

    Intent intent = new Intent(wls, MainActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    wls.startActivity(intent);
}