For whats this "1342177280" flag for?

Viewed 208

I have some code snippet for opening whatsapp with some flags as bellow

  Intent intent = new Intent();
            intent.setClassName("com.whatsapp", "com.whatsapp.HomeActivity");
            intent.addFlags(1342177280);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivityForResult(intent, 9);

Above snippet showing error on 1342177280 as bellow

Error image here

I don't understand that whats this flag 1342177280 about , Any idea ?

1 Answers

I'm extending on codebod's comment

The warning is because you are using an explicit integer rather than drawing on the 'approved' list of flags.

Intent's addFlags() method takes an int parameter that are predefined in the android framework as constants. The predefined constants have corresponding integer value. You are seeing that error as the integer value you entered doesn't match with any of the predefined values.

Check this documentation to see the list of valid parameters Intent's addFlags() method can accept.

Related