Back to project page TheFirstMyth01.
The source code is released under:
MIT License
If you think the Android project TheFirstMyth01 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.gametest1; // w w w . j a v a 2 s . c o m import android.os.Bundle; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.pm.ActivityInfo; import android.view.Window; import android.view.WindowManager; public class GameActivity extends Activity { private GameView msf; @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // ???????-????????????????? this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); requestWindowFeature(Window.FEATURE_NO_TITLE); // ????? setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); msf = new GameView(this); setContentView(msf); // setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);?????? } @Override public void onBackPressed() { // TODO Auto-generated method stub new AlertDialog.Builder(this) /* ???????????? */ .setTitle("??????") /* ???????????? */ .setIcon(R.drawable.ic_launcher) /* ????????????? */ .setMessage("??????????????") .setPositiveButton("??", new DialogInterface.OnClickListener() { // ?? public void onClick( DialogInterface dialoginterface, int i) { android.os.Process .killProcess(android.os.Process .myPid()); // SoundManager.Instance.stopBackgroundSound(); } }) .setNegativeButton("????", new DialogInterface.OnClickListener() { /* ????????????? */ public void onClick( DialogInterface dialoginterface, int i) { // ??????? } }).show(); } public void onPause() { super.onPause(); } }