Q:

Bundle is not null at the first run

I have a strange problem
I created a Bundle on MainActivity
And condition if (bundle! = Null)
But in the first run, the program is n null and the program closes. my code:
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_class);
    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {

        Log.d("tag", "onCreate0: ");
        Width = Double.parseDouble(bundle.getString("Width"));
        height = Double.parseDouble(bundle.getString("height"));

    }

}

A:

I solved it myself
 Intent intent11 = new Intent(context, MainClass.class);
                int strName = -1;
                intent11.putExtra("STRING_I_NEED", strName);
                intent11.putExtra("Width", Width);
                intent11.putExtra("height", height);
                intent11.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(intent11);

  Bundle bundle = getIntent().getExtras();

    if (bundle != null) {

        if (bundle.getInt("STRING_I_NEED") == -1) {
            Width = Double.parseDouble(bundle.getString("Width"));
            height = Double.parseDouble(bundle.getString("height"));
        }
    }

