create new Cocos2dxActivity instance when BroadcastReceiver onReceive

HI,

I am using cocos2d-x 2.1.4 now.

`public class Example extends Cocos2dxActivity
{
private BroadcastReceiver mSmsRecv;
private IntentFilter mSmsFilter;

protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
            Log.d("cocos2d-x","Create new Instance Now!!!!!");
            registerSmsBroadcast();
}

private void registerSmsBroadcast(){
  mSmsRecv = (content,intent)->{
      Log.d("cocos2d-x","recv sms");
  };
  mSmsFilter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
  registerReceiver(mSmsRecv,mSmsFilter);
}

}

`
Using intellij debug key store run:
Run game~~> “Create new Instance Now![](" -> Recv sms : log output “recv sms”
The main activity instance is same one.

Using own keystone sign apk:
Run game-> "Create new Instance Now)”~~> Recv sms: log output “Create new Instance Now!” -> black screen
It seems like that created a new instance.

Why??? plz help me

Go to AndroidManifest.xml and add attribute android:launchMode="singleTask" to your game activity. No new instances will be created after this change.

Sergey Shambir wrote:

Go to AndroidManifest.xml and add attribute android:launchMode="singleTask" to your game activity. No new instances will be created after this change.

Thank you very much