BaseConfigActivity: Move menu handling to ConfigActivity

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland 2017-08-15 16:08:38 -05:00
parent d91770a1b6
commit cfcda8bd13
2 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,6 @@ import android.content.Intent;
import android.content.ServiceConnection; import android.content.ServiceConnection;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder; import android.os.IBinder;
import android.view.Menu;
import com.wireguard.config.Config; import com.wireguard.config.Config;
@ -45,12 +44,6 @@ abstract class BaseConfigActivity extends Activity {
initialConfig = getIntent().getStringExtra(KEY_CURRENT_CONFIG); initialConfig = getIntent().getStringExtra(KEY_CURRENT_CONFIG);
} }
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
protected abstract void onCurrentConfigChanged(Config config); protected abstract void onCurrentConfigChanged(Config config);
@Override @Override

View File

@ -6,6 +6,7 @@ import android.app.FragmentTransaction;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import com.wireguard.config.Config; import com.wireguard.config.Config;
@ -48,6 +49,12 @@ public class ConfigActivity extends BaseConfigActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override @Override
protected void onCurrentConfigChanged(final Config config) { protected void onCurrentConfigChanged(final Config config) {
Log.d(getClass().getSimpleName(), "onCurrentConfigChanged config=" + (config != null ? Log.d(getClass().getSimpleName(), "onCurrentConfigChanged config=" + (config != null ?