From fa6e7662df0b4d134360c7c84ca1db192c8aa4fc Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期二, 11 九月 2018 14:36:33 +0800
Subject: [PATCH] update 猫耳更换appid
---
Project/app/src/main/java/com/secondworld/univeralsdk/MainActivity.java | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/Project/app/src/main/java/com/secondworld/univeralsdk/MainActivity.java b/Project/app/src/main/java/com/secondworld/univeralsdk/MainActivity.java
index 6a82c9b..4a19082 100644
--- a/Project/app/src/main/java/com/secondworld/univeralsdk/MainActivity.java
+++ b/Project/app/src/main/java/com/secondworld/univeralsdk/MainActivity.java
@@ -19,7 +19,7 @@
public class MainActivity extends UnityPlayerActivity
{
private static final String TAG = "MainActivity";
-
+ public static boolean isForeground = false;
// 鍚敤6.0浠ヤ笂鏉冮檺鍥炶皟code
// private static final int CODE_REQUEST_PERMISSION = 1000;
@@ -37,16 +37,28 @@
View unityView = mUnityPlayer.getView();
_frameLayout.addView(unityView);
- H2EngineSDK.onCreate(savedInstanceState);
+ H2EngineSDK.onCreate(this, savedInstanceState);
+ }
+
+ @Override
+ public void onWindowFocusChanged(boolean b)
+ {
+ super.onWindowFocusChanged(b);
+ H2EngineSDK.onWindowFocusChanged(b);
}
@Override
protected void onNewIntent(Intent intent)
{
- H2EngineSDK.onNewIntent(intent);
-
super.onNewIntent(intent);
- LogUtil.i(TAG, "onNewIntent");
+ H2EngineSDK.onNewIntent(this, intent);
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data)
+ {
+ H2EngineSDK.onActivityResult(requestCode, resultCode, data, this);
+ super.onActivityResult(requestCode, resultCode, data);
}
@Override
@@ -55,7 +67,6 @@
H2EngineSDK.onConfigurationChanged(newConfig);
super.onConfigurationChanged(newConfig);
- LogUtil.i(TAG, "onConfigurationChanged");
}
@Override
@@ -64,35 +75,34 @@
H2EngineSDK.onStart(this);
super.onStart();
- LogUtil.i(TAG, "onStart");
}
@Override
protected void onStop()
{
+ isForeground = false;
H2EngineSDK.onStop(this);
super.onStop();
- LogUtil.i(TAG, "onStop");
}
@Override
protected void onResume()
{
+ isForeground = true;
H2EngineSDK.onResume(this);
super.onResume();
- LogUtil.i(TAG, "onResume");
// 妫�娴嬫湰鍦板瓨鍌ㄦ潈闄愭槸鍚︽湁, 娌℃湁鐨勮瘽瑕佹彁绀虹敤鎴�
if (PermissionChecker.checkPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Process.myPid(), Process.myUid(),
getPackageName()) != PackageManager.PERMISSION_GRANTED
- || PermissionChecker.checkPermission(this,
- Manifest.permission.READ_EXTERNAL_STORAGE,
- Process.myPid(), Process.myUid(),
- getPackageName()) != PackageManager.PERMISSION_GRANTED)
+ || PermissionChecker.checkPermission(this,
+ Manifest.permission.READ_EXTERNAL_STORAGE,
+ Process.myPid(), Process.myUid(),
+ getPackageName()) != PackageManager.PERMISSION_GRANTED)
{
new AlertDialog.Builder(this)
.setMessage("搴旂敤娌℃湁瀛樺偍璇诲彇鏉冮檺,鐐瑰嚮纭畾鑷宠缃腑寮�鍚�,鍚﹀垯鏃犳硶缁х画娓告垙.")
@@ -135,7 +145,6 @@
H2EngineSDK.onPause(this);
super.onPause();
- LogUtil.i(TAG, "onPause");
}
@Override
@@ -144,7 +153,6 @@
H2EngineSDK.onDestroy(this);
super.onDestroy();
- LogUtil.i(TAG, "onDestroy");
}
@Override
@@ -153,7 +161,6 @@
H2EngineSDK.onRestart(this);
super.onRestart();
- LogUtil.i(TAG, "onRestart");
}
}
--
Gitblit v1.8.0