本文整理匯總了Java中org.chromium.chrome.browser.physicalweb.PhysicalWeb.startPhysicalWeb方法的典型用法代碼示例。如果您正苦於以下問題:Java PhysicalWeb.startPhysicalWeb方法的具體用法?Java PhysicalWeb.startPhysicalWeb怎麽用?Java PhysicalWeb.startPhysicalWeb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.chromium.chrome.browser.physicalweb.PhysicalWeb
的用法示例。
在下文中一共展示了PhysicalWeb.startPhysicalWeb方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onRequestPermissionsResult
import org.chromium.chrome.browser.physicalweb.PhysicalWeb; //導入方法依賴的package包/類
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[],
int[] grantResults) {
switch (requestCode) {
case REQUEST_ID:
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
PhysicalWebUma.onPrefsLocationGranted(getActivity());
Log.d(TAG, "Location permission granted");
PhysicalWeb.startPhysicalWeb();
} else {
PhysicalWebUma.onPrefsLocationDenied(getActivity());
Log.d(TAG, "Location permission denied");
}
break;
default:
}
}
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:19,代碼來源:PhysicalWebPreferenceFragment.java
示例2: setPhysicalWebEnabled
import org.chromium.chrome.browser.physicalweb.PhysicalWeb; //導入方法依賴的package包/類
/**
* Sets the Physical Web preference, which enables background scanning for bluetooth beacons
* and displays a notification when beacons are found.
*
* @param enabled A boolean indicating whether to notify on nearby beacons.
*/
public void setPhysicalWebEnabled(boolean enabled) {
int state = enabled ? PHYSICAL_WEB_ON : PHYSICAL_WEB_OFF;
boolean isOnboarding = isPhysicalWebOnboarding();
mSharedPreferences.edit().putInt(PREF_PHYSICAL_WEB, state).apply();
if (enabled) {
if (!isOnboarding) {
PhysicalWeb.startPhysicalWeb();
}
} else {
PhysicalWeb.stopPhysicalWeb();
}
}