Java 类com.google.android.gms.wearable.WearableListenerService 实例源码

项目:sensordatacollector    文件:Tasks.java   
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);
}