summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Beattie <mike@ethernal.org>2012-08-30 21:08:06 +1200
committerMike Beattie <mike@ethernal.org>2012-08-30 21:08:06 +1200
commit2e6af70c87e7cc62a92b09bbbde745a31d83b5eb (patch)
tree0c69fbbaf3e0f8edee50b6e12d55a36c9fa8bf21
parent519887571cee2840024c5c8f4b7f0e5c352d3323 (diff)
altosdroid: Move bluetooth check to first task
Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
index 7d6a8044..bc129fee 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
@@ -216,6 +216,16 @@ public class AltosDroid extends Activity {
super.onCreate(savedInstanceState);
if(D) Log.e(TAG, "+++ ON CREATE +++");
+ // Get local Bluetooth adapter
+ mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+
+ // If the adapter is null, then Bluetooth is not supported
+ if (mBluetoothAdapter == null) {
+ Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
+ finish();
+ return;
+ }
+
// Set up the window layout
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
//setContentView(R.layout.main);
@@ -247,16 +257,6 @@ public class AltosDroid extends Activity {
mLatitudeView = (TextView) findViewById(R.id.latitude_value);
mLongitudeView = (TextView) findViewById(R.id.longitude_value);
- // Get local Bluetooth adapter
- mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-
- // If the adapter is null, then Bluetooth is not supported
- if (mBluetoothAdapter == null) {
- Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
- finish();
- return;
- }
-
// Enable Text to Speech
tts = new TextToSpeech(this, new OnInitListener() {
public void onInit(int status) {