1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-08 19:21:35 +00:00

Fixed ActionBar up button not working in all activities (ref #49).

This commit is contained in:
Felix Ableitner 2014-07-01 13:52:59 +02:00
parent 821206b97c
commit ad1138e5c5
4 changed files with 13 additions and 14 deletions

View file

@ -47,25 +47,13 @@
<activity
android:name=".gui.RepoSettingsActivity"
android:theme="@style/DialogWhenLarge" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".gui.MainActivity" />
</activity>
android:theme="@style/DialogWhenLarge" />
<activity
android:name=".gui.NodeSettingsActivity"
android:theme="@style/DialogWhenLarge" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".gui.MainActivity" />
</activity>
android:theme="@style/DialogWhenLarge" />
<activity
android:name=".gui.FolderPickerActivity"
android:label="@string/folder_picker_title" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".gui.RepoSettingsActivity"
android:uiOptions="splitActionBarWhenNarrow"/>
<meta-data
android:name="android.support.UI_OPTIONS"
android:value="splitActionBarWhenNarrow" />

View file

@ -72,6 +72,8 @@ public class FolderPickerActivity extends ActionBarActivity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.folder_picker_activity);
mListView = (ListView) findViewById(android.R.id.list);
mListView.setOnItemClickListener(this);
@ -126,6 +128,9 @@ public class FolderPickerActivity extends ActionBarActivity
setResult(Activity.RESULT_OK, intent);
finish();
return true;
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}

View file

@ -169,6 +169,9 @@ public class NodeSettingsActivity extends PreferenceActivity implements
case R.id.share_node_id:
RestApi.shareNodeId(this, mNode.NodeID);
return true;
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}

View file

@ -200,6 +200,9 @@ public class RepoSettingsActivity extends PreferenceActivity
mSyncthingService.getApi().editRepo(mRepo, true);
finish();
return true;
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}