mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-29 15:51:17 +00:00
Added exit button to stop background service.
This commit is contained in:
parent
65bc9c46da
commit
f12acb2b9b
3 changed files with 12 additions and 1 deletions
|
@ -5,4 +5,8 @@
|
|||
android:id="@+id/report_issue"
|
||||
android:title="@string/report_issue" />
|
||||
|
||||
<item
|
||||
android:id="@+id/exit"
|
||||
android:title="@string/exit" />
|
||||
|
||||
</menu>
|
||||
|
|
|
@ -6,9 +6,12 @@
|
|||
<!-- Text for WebGuiActivity loading view -->
|
||||
<string name="web_gui_loading">Waiting for GUI</string>
|
||||
|
||||
<!-- Menu item "report issue" that opens issue tracker -->
|
||||
<!-- Menu item that opens issue tracker -->
|
||||
<string name="report_issue">Report Issue</string>
|
||||
|
||||
<!-- Menu item that stops Activity and Service -->
|
||||
<string name="exit">Exit</string>
|
||||
|
||||
<!-- URL of the issue tracker -->
|
||||
<string name="issue_tracker_url" translatable="false">https://github.com/Nutomic/syncthing-android/issues</string>
|
||||
|
||||
|
|
|
@ -86,6 +86,10 @@ public class WebGuiActivity extends Activity {
|
|||
case R.id.report_issue:
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.issue_tracker_url))));
|
||||
return true;
|
||||
case R.id.exit:
|
||||
stopService(new Intent(this, SyncthingService.class));
|
||||
finish();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue