run bluetooth adapter enabling/disabling in background thread

also run setting the default preferences in a background thread

Closes #184
This commit is contained in:
Torsten Grote
2016-01-19 11:10:34 -02:00
parent 05a83dc32c
commit f9f3696fb9
4 changed files with 29 additions and 5 deletions

View File

@@ -65,8 +65,7 @@ public class SplashScreenActivity extends RoboSplashActivity {
logo.setImageResource(R.drawable.briar_logo_large);
layout.addView(logo);
PreferenceManager
.setDefaultValues(this, R.xml.panic_preferences, false);
setPreferencesDefaults();
setContentView(layout);
}
@@ -111,4 +110,15 @@ public class SplashScreenActivity extends RoboSplashActivity {
if (f.isFile()) f.delete();
else if (f.isDirectory()) for (File child : f.listFiles()) delete(child);
}
private void setPreferencesDefaults() {
new Thread() {
@Override
public void run() {
PreferenceManager
.setDefaultValues(SplashScreenActivity.this,
R.xml.panic_preferences, false);
}
}.start();
}
}