| | |
| | | package com.secondworld.sdk; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.AlertDialog; |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.view.KeyEvent; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | |
| | | |
| | | public class GTGameMain extends GameActivityProxy { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { |
| | | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { |
| | | super.onRequestPermissionsResult(requestCode, permissions, grantResults); |
| | | MySdkMgr.I.onRequestPermissionsResult(requestCode, permissions, grantResults); |
| | | } |
| | |
| | | @Override |
| | | public boolean onKeyDown(int keyCode, KeyEvent event) { |
| | | if (keyCode == KeyEvent.KEYCODE_BACK) { |
| | | // 游戏调用自身的退出对话框,点击确定后,调用quick的exit接口 |
| | | new AlertDialog.Builder(activity).setTitle("退出").setMessage("是否退出游戏?").setPositiveButton("确定", new DialogInterface.OnClickListener() { |
| | | @Override |
| | | public void onClick(DialogInterface arg0, int arg1) { |
| | | MySdkMgr.manger.exit(GTGameMain.I.activity); |
| | | } |
| | | }).setNegativeButton("取消", null).show(); |
| | | MySdkMgr.manger.exit(GTGameMain.I.activity); |
| | | return true; |
| | | } |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | |
| | | @Override |
| | | public void onNewIntent(Intent intent) { |
| | | super.onNewIntent(intent); |
| | | MySdkMgr.manger.onNewIntent(intent); |
| | | } |
| | | |
| | | } |