The two codes are almost identical, with a few minor differences as follows:
1. Addition of a new request code in the second version:
- In the second version of the code, a new constant has been added:
public static final int POSITION_REQUEST_CODE = 776;
- This does not exist in the first version, so it is an addition in the second version.
2. Logic:
- Apart from this addition, the logic and behavior of the code are strictly identical between the two versions.
- The methods, such as
checkStoragePermissions
,checkReadStoragePermissions
,checkWriteStoragePermissions
,checkPostNotificationsPermission
,checkSystemAlertWindowPermission
, andisPopupEnabledElseAsk
are identical in both versions.
Conclusion:
- The second version simply contains an added constant (
POSITION_REQUEST_CODE
), while the rest of the code is unchanged. - If this addition is necessary for a future feature, the second version is the one to use; otherwise, both versions behave the same way.
Les deux codes sont presque identiques, avec quelques différences mineures que voici :
1. Ajout d'un nouveau code de demande dans la deuxième version :
- Dans la deuxième version du code, une nouvelle constante a été ajoutée :
public static final int POSITION_REQUEST_CODE = 776;
- Cela n'existe pas dans la première version, donc il s'agit d'un ajout dans la seconde.
2. Logique :
- À part cet ajout, la logique et le comportement du code sont strictement identiques entre les deux versions.
- Les méthodes, telles que
checkStoragePermissions
,checkReadStoragePermissions
,checkWriteStoragePermissions
,checkPostNotificationsPermission
,checkSystemAlertWindowPermission
, etisPopupEnabledElseAsk
sont identiques dans les deux versions.
Conclusion :
- La seconde version contient simplement un ajout de constante (
POSITION_REQUEST_CODE
), tandis que le reste des codes est inchangé. - Si cet ajout est nécessaire pour une fonctionnalité future, la seconde version est celle à utiliser ; sinon, les deux versions se comportent de la même manière.