@@ -65,9 +65,9 @@ Now you can use the following snippet codes to retrieve IMEI number and Serial N
6565Snippet code to use to retrieve the Serial Number of the device:
6666
6767``` java
68- private void getSerialNumber()
68+ private void getSerialNumber(Context context )
6969 {
70- DIHelper . getSerialNumber(this , new IDIResultCallbacks () {
70+ DIHelper . getSerialNumber(context , new IDIResultCallbacks () {
7171 @Override
7272 public void onSuccess (String message ) {
7373 // The message contains the serial number
@@ -91,9 +91,9 @@ Snippet code to use to retrieve the Serial Number of the device:
9191Snippet code to use to retrieve the Serial Number of the device:
9292
9393``` java
94- private void getIMEINumber()
94+ private void getIMEINumber(Context context )
9595 {
96- DIHelper . getIMEINumber(this , new IDIResultCallbacks () {
96+ DIHelper . getIMEINumber(context , new IDIResultCallbacks () {
9797 @Override
9898 public void onSuccess (String message ) {
9999 // We've got an EMEI number
@@ -118,16 +118,16 @@ As the previous methods are asynchronous, if you need both information, it is st
118118
119119Sample code if you need to get both device identifiers:
120120``` java
121- private void getDevicesIdentifiers()
121+ private void getDevicesIdentifiers(Context context )
122122 {
123123 // We first ask for the SerialNumber
124- DIHelper . getSerialNumber(this , new IDIResultCallbacks () {
124+ DIHelper . getSerialNumber(context , new IDIResultCallbacks () {
125125 @Override
126126 public void onSuccess (String message ) {
127127 // The message contains the serial number
128128 String mySerialNumber = message;
129129 // We've got the serial number, now we can ask for the IMEINumber
130- getIMEINumber();
130+ getIMEINumber(context );
131131 }
132132
133133 @Override
@@ -136,7 +136,7 @@ Sample code if you need to get both device identifiers:
136136 // Do something here with the error message
137137 // We had an error with the Serial Number, but it
138138 // doesn't prevent us from calling the getIMEINumber method
139- getIMEINumber();
139+ getIMEINumber(context );
140140 }
141141
142142 @Override
0 commit comments