From 72441be56007baa67701c1a628821f2e6ec2b742 Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Tue, 13 Sep 2011 20:23:06 +0200 Subject: [PATCH] bluetooth: reload list of BT devices --- src/BluetoothDevicePreference.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/BluetoothDevicePreference.java b/src/BluetoothDevicePreference.java index 0a03a4f..71e219b 100644 --- a/src/BluetoothDevicePreference.java +++ b/src/BluetoothDevicePreference.java @@ -11,7 +11,10 @@ public BluetoothDevicePreference(Context context, AttributeSet attrs) { super(context, attrs); + } + protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder builder) { + // hook into the builder to refresh the list BluetoothAdapter bta = BluetoothAdapter.getDefaultAdapter(); Set pairedDevices = bta.getBondedDevices(); CharSequence[] entries = new CharSequence[pairedDevices.size()]; @@ -24,6 +27,8 @@ } setEntries(entries); setEntryValues(entryValues); + + super.onPrepareDialogBuilder(builder); } public BluetoothDevicePreference(Context context) {