Add BluetoothSensorManager toast message in strings.xml.

This commit is contained in:
Jimmy Shih
2012-05-29 10:53:35 -07:00
parent 9e5d9d23de
commit ac55add2b9
4 changed files with 13 additions and 9 deletions
+6
View File
@@ -1745,6 +1745,12 @@ limitations under the License.
%1$d: sensor id number. E.g., '1'."> %1$d: sensor id number. E.g., '1'.">
Paired with: %1$d. Paired with: %1$d.
</string> </string>
<string name="settings_sensor_bluetooth_connected"
translation_description="The message when connected to a bluetooth sensor.
%1$s: sensor name. E.g., 'polar bluetooth'.">
Connected to %1$s
</string>
<string name="settings_sensor_bluetooth_options" <string name="settings_sensor_bluetooth_options"
translation_description="In the 'Sensor' settings, the section header to configure the Bluetooth translation_description="In the 'Sensor' settings, the section header to configure the Bluetooth
options. options.
@@ -172,8 +172,7 @@ public class ImportActivity extends Activity {
if (success) { if (success) {
showDialog(DIALOG_RESULT_ID); showDialog(DIALOG_RESULT_ID);
} else { } else {
Toast.makeText(this, getString(R.string.sd_card_import_error), Toast.LENGTH_LONG) Toast.makeText(this, R.string.sd_card_import_error, Toast.LENGTH_LONG).show();
.show();
finish(); finish();
} }
} }
@@ -154,7 +154,7 @@ class DataSourcesWrapperImpl implements DataSourcesWrapper {
} }
// Let the user know we have only an approximate location: // Let the user know we have only an approximate location:
Toast.makeText(context, context.getString(toastResId), Toast.LENGTH_LONG).show(); Toast.makeText(context, toastResId, Toast.LENGTH_LONG).show();
} }
return loc; return loc;
} }
@@ -208,12 +208,11 @@ public class BluetoothSensorManager extends SensorManager {
} }
break; break;
case BluetoothConnectionManager.MESSAGE_DEVICE_NAME: case BluetoothConnectionManager.MESSAGE_DEVICE_NAME:
// save the connected device's name // Save the connected device name
connectedDeviceName = connectedDeviceName = msg.getData().getString(BluetoothConnectionManager.DEVICE_NAME);
msg.getData().getString(BluetoothConnectionManager.DEVICE_NAME); Toast.makeText(context,
Toast.makeText(context.getApplicationContext(), context.getString(R.string.settings_sensor_bluetooth_connected, connectedDeviceName),
"Connected to " + connectedDeviceName, Toast.LENGTH_SHORT) Toast.LENGTH_SHORT).show();
.show();
break; break;
} }
} }