I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit ccbbc3c3 authored by str4d's avatar str4d
Browse files

Added link from Log Activity to Logging settings

TODO: Fix link for Preference headers
parent b9374b5e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@
- Change navbar first-open mechanics to match Android design docs
- Pull out internal I2P web browser, or disable it
- What will this require elsewhere?
- Add link from Log Activity to Logging settings
# Short-term
......
......@@ -2,9 +2,14 @@ package net.i2p.android.router.log;
import net.i2p.android.router.I2PActivityBase;
import net.i2p.android.router.R;
import net.i2p.android.router.SettingsActivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.SpinnerAdapter;
......@@ -68,6 +73,35 @@ public class LogActivity extends I2PActivityBase implements
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main_actions, menu);
// Help menu not needed (yet), hide
menu.findItem(R.id.menu_help).setVisible(false);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_settings:
Intent intent = new Intent(LogActivity.this, SettingsActivity.class);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
intent.setAction("net.i2p.android.router.PREFS_LOGGING");
} else { // TODO: Test if this works, fix if not
Bundle args = new Bundle();
args.putString("settings", "logging");
intent.putExtras(args);
}
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment