Move to a generic Menu activity from which actual App-level

functionality will be built.
This way, we can program the menus once for all.
This commit is contained in:
bspeice 2013-10-03 18:35:39 -04:00
parent 82804a9d67
commit 412f894d92
4 changed files with 4 additions and 102 deletions

View File

@ -1,35 +1,6 @@
package com.uncc.gameday.activities; package com.uncc.gameday.activities;
import com.uncc.gameday.R;
import android.os.Bundle; public class Alerts extends MenuActivity {
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
public class Alerts extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_alerts);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.alerts, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.action_alert_settings:
startActivity(new Intent(this, Alerts.class));
}
return true;
}
} }

View File

@ -1,37 +1,6 @@
package com.uncc.gameday.activities; package com.uncc.gameday.activities;
import com.uncc.gameday.R;
import com.uncc.gameday.R.layout;
import com.uncc.gameday.R.menu;
import android.os.Bundle; public class Home extends MenuActivity {
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
public class Home extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.home, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.action_alert_settings:
startActivity(new Intent(this, Alerts.class));
}
return true;
}
} }

View File

@ -1,24 +1,6 @@
package com.uncc.gameday.activities; package com.uncc.gameday.activities;
import com.uncc.gameday.R;
import android.os.Bundle; public class Parking extends MenuActivity {
import android.app.Activity;
import android.view.Menu;
public class Parking extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_parking);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.parking, menu);
return true;
}
} }

View File

@ -1,26 +1,6 @@
package com.uncc.gameday.activities; package com.uncc.gameday.activities;
import com.uncc.gameday.R;
import com.uncc.gameday.R.layout;
import com.uncc.gameday.R.menu;
import android.os.Bundle; public class Registration extends MenuActivity {
import android.app.Activity;
import android.view.Menu;
public class Registration extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.registration, menu);
return true;
}
} }