本文整理匯總了Java中com.google.android.gms.wearable.WearableListenerService類的典型用法代碼示例。如果您正苦於以下問題:Java WearableListenerService類的具體用法?Java WearableListenerService怎麽用?Java WearableListenerService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WearableListenerService類屬於com.google.android.gms.wearable包,在下文中一共展示了WearableListenerService類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: startWearableApp
import com.google.android.gms.wearable.WearableListenerService; //導入依賴的package包/類
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);
}