mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 03:11:30 +00:00
Add ActionBar back button to repo/node settings Activities.
This commit is contained in:
parent
505ec379b6
commit
0a4121e6cf
3 changed files with 10 additions and 2 deletions
|
@ -6,6 +6,7 @@ import android.content.Context;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.preference.EditTextPreference;
|
||||
|
@ -69,6 +70,10 @@ public class NodeSettingsActivity extends PreferenceActivity implements
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
if (getIntent().getAction().equals(ACTION_CREATE)) {
|
||||
addPreferencesFromResource(R.xml.node_settings_create);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.content.Context;
|
|||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.IBinder;
|
||||
|
@ -80,6 +81,10 @@ public class RepoSettingsActivity extends PreferenceActivity
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
if (getIntent().getAction().equals(ACTION_CREATE)) {
|
||||
addPreferencesFromResource(R.xml.repo_settings_create);
|
||||
}
|
||||
|
|
|
@ -110,8 +110,6 @@ public class SettingsActivity extends PreferenceActivity
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// There is currently no way to get ActionBar in PreferenceActivity on pre-honeycomb with
|
||||
// compatibility library, so we'll have to do a version check.
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue