Settings handling
This commit is contained in:
parent
0d67614456
commit
d2ef2a958c
5 changed files with 11 additions and 26 deletions
app/src/main/java/info/nerull7/mysqlbrowser
|
@ -31,9 +31,9 @@ public class DatabaseActivity extends Activity {
|
|||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
|
||||
//TODO Handling menu
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_settings) {
|
||||
Static.startSettings(this);
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
|
|
@ -23,25 +23,4 @@ public class EntriesActivity extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
|
||||
//TODO Handling menu
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,11 +33,9 @@ public class MainActivity extends Activity {
|
|||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
|
||||
//TODO Handling menu
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_settings) {
|
||||
Intent intent = new Intent(this, SettingsActivity.class);
|
||||
startActivity(intent);
|
||||
Static.startSettings(this);
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package info.nerull7.mysqlbrowser;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import info.nerull7.mysqlbrowser.db.DatabaseConnector;
|
||||
|
||||
/**
|
||||
|
@ -13,4 +16,9 @@ public class Static {
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void startSettings(Context context){
|
||||
Intent intent = new Intent(context, SettingsActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,9 +35,9 @@ public class TableActivity extends Activity {
|
|||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
|
||||
//TODO Handling menu
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.action_settings) {
|
||||
Static.startSettings(this);
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue