1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 11:21:29 +00:00

Start Syncthing service earlier

This commit is contained in:
Felix Ableitner 2017-09-05 11:45:29 +09:00
parent 7b95baa2a3
commit 6857118305
2 changed files with 7 additions and 10 deletions

View file

@ -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() {

View file

@ -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);