mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-23 04:41:16 +00:00
Start Syncthing service earlier
This commit is contained in:
parent
7b95baa2a3
commit
6857118305
2 changed files with 7 additions and 10 deletions
|
@ -15,6 +15,7 @@ import android.widget.Button;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.nutomic.syncthingandroid.R;
|
||||
import com.nutomic.syncthingandroid.service.SyncthingService;
|
||||
|
||||
public class FirstStartActivity extends Activity implements Button.OnClickListener {
|
||||
|
||||
|
@ -28,20 +29,22 @@ public class FirstStartActivity extends Activity implements Button.OnClickListen
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_first_start);
|
||||
|
||||
startService(new Intent(this, SyncthingService.class));
|
||||
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
Button cont = (Button) findViewById(R.id.cont);
|
||||
cont.setOnClickListener(this);
|
||||
|
||||
if (!isFirstStart()) {
|
||||
if (haveStoragePermission()) {
|
||||
startApp();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
requestStoragePermission();
|
||||
}
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_first_start);
|
||||
Button cont = (Button) findViewById(R.id.cont);
|
||||
cont.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private boolean isFirstStart() {
|
||||
|
|
|
@ -40,12 +40,6 @@ public abstract class SyncthingActivity extends ToolbarBindingActivity implement
|
|||
void onServiceConnected();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
startService(new Intent(this, SyncthingService.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
unbindService(this);
|
||||
|
|
Loading…
Reference in a new issue