menu entry for restore backup

This commit is contained in:
arrase 2016-11-22 01:24:23 +01:00
parent 57a7b0dbc7
commit 7600b4c58c
3 changed files with 27 additions and 0 deletions

View File

@ -8,6 +8,8 @@ import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
@ -87,6 +89,24 @@ public class HiddenServicesActivity extends AppCompatActivity {
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.hs_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.menu_restore_backup) {
// TODO: Restore backup
return true;
}
return super.onOptionsItemSelected(item);
}
class HSObserver extends ContentObserver {
HSObserver(Handler handler) {
super(handler);

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_restore_backup"
android:title="@string/restore_backup" />
</menu>

View File

@ -346,4 +346,5 @@
<string name="please_grant_permissions_for_external_storage">Please grant permissions for external storage</string>
<string name="permission_granted">Permission granted</string>
<string name="permission_denied">Permission denied</string>
<string name="restore_backup">Restore Backup</string>
</resources>