mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12915 from yangws/issue_12887
Fixed #12887 : [Android] Cocos2dxHelper will not be initialized after…
This commit is contained in:
commit
371053305e
|
@ -91,10 +91,10 @@ public class Cocos2dxHelper {
|
|||
|
||||
private static boolean sInited = false;
|
||||
public static void init(final Activity activity) {
|
||||
sActivity = activity;
|
||||
Cocos2dxHelper.sCocos2dxHelperListener = (Cocos2dxHelperListener)activity;
|
||||
if (!sInited) {
|
||||
final ApplicationInfo applicationInfo = activity.getApplicationInfo();
|
||||
|
||||
Cocos2dxHelper.sCocos2dxHelperListener = (Cocos2dxHelperListener)activity;
|
||||
|
||||
Cocos2dxHelper.sPackageName = applicationInfo.packageName;
|
||||
if (CocosPlayClient.isEnabled() && !CocosPlayClient.isDemo()) {
|
||||
|
@ -113,7 +113,6 @@ public class Cocos2dxHelper {
|
|||
Cocos2dxHelper.nativeSetContext((Context)activity, Cocos2dxHelper.sAssetManager);
|
||||
|
||||
Cocos2dxBitmap.setContext(activity);
|
||||
sActivity = activity;
|
||||
|
||||
Cocos2dxHelper.sVibrateService = (Vibrator)activity.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
|
||||
|
|
Loading…
Reference in New Issue