該如何設定開關,啟動搜尋、不要一開始就設定接收

這一段好像是EddyStone的
可以改成四月兄弟的Beacone嗎?

BeaconManager.startRanging 是启动搜索beacon
BeaconManager.stopRanging 是停止搜索beacon
EddyStoneScanActivity中 initScan函数中你可以看到启动扫描EddyStone

要如何在這裡控制?
BeaconManager.startRanging 該如何設定按鍵來控制呢老闆:(

开启扫描startRanging
停止扫描stopRanging

老闆我設定好了
public void startRanging(View v) throws RemoteException {
beaconManager.startRanging(ALL_BEACONS_REGION);
}

public void stopRanging(View v) throws RemoteException {
	beaconManager.stopRanging(ALL_BEACONS_REGION);
}

要怎麼設定開啟APP後才選擇按鈕執行掃描
不要一開起就掃描
謝謝老闆的指教

onStart中的connectService中的startRanging注释掉

註解掉這段嗎?

protected void onStart() {
	super.onStart();

	if (!beaconManager.hasBluetooth()) {
		Toast.makeText(this, "Device does not have Bluetooth Low Energy",
				Toast.LENGTH_LONG).show();
		return;
	}

	if (!beaconManager.isBluetoothEnabled()) {
		Intent enableBtIntent = new Intent(
				BluetoothAdapter.ACTION_REQUEST_ENABLE);
		startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
	}else {
		connectToService();
	}
}

這裡面沒有connectService

connectToService中的startRanging注释掉