Back to project page TheFirstMyth02.
The source code is released under:
MIT License
If you think the Android project TheFirstMyth02 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.game.fengshen; //from w w w . j av a 2 s. com import com.example.fengshen.R; 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.icon) .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(); } }