@Override protected void onResume() { if (db.selectScore() == 0) { findViewById(R.id.button2).setVisibility(View.INVISIBLE); } else { findViewById(R.id.button2).setVisibility(View.VISIBLE); } super.onResume(); }
@Override protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); super.onCreate(savedInstanceState); setContentView(R.layout.home); CustomApplication cApp = (CustomApplication) getApplicationContext(); db = cApp.getDBAdapter(); if (db.selectScore() == 0) { findViewById(R.id.button2).setVisibility(View.INVISIBLE); } else { findViewById(R.id.button2).setVisibility(View.VISIBLE); } }
public void launchNewGame(View v) { db.deleteSavedGame(); Intent myIntent = new Intent(HomeActivity.this, AdralchimieActivity.class); HomeActivity.this.startActivity(myIntent); }