Code example for BluetoothAdapter

Methods: enable

0
	private BluetoothAdapter _bluetooth = BluetoothAdapter.getDefaultAdapter();
 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		refresh(); 
		_bluetooth.enable();
	} 
 
	public void refresh() { 
		SharedPreferences settings = getSharedPreferences("locale", 0);
		int position = settings.getInt("Locale", 0);
		Locale locale2;
		Configuration config = new Configuration();
		if (position == 0) {
			locale2 = Locale.ENGLISH;
			Locale.setDefault(locale2);
			config.locale = locale2;
		} else if (position == 1) {
			locale2 = Locale.CHINA;
			Locale.setDefault(locale2);
Experience pair programming with AI  Get Codota for Java