Merge pull request #12915 from yangws/issue_12887

Fixed #12887 : [Android] Cocos2dxHelper will not be initialized after…
This commit is contained in:
pandamicro 2015-07-20 14:01:21 +08:00
commit 371053305e
1 changed files with 2 additions and 3 deletions

View File

@ -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);