Showing
2 changed files
with
49 additions
and
46 deletions
... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
2 | 2 | ||
3 | ext { | 3 | ext { |
4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
5 | - PUBLISH_VERSION = '4.5.4.6rc1' | 5 | + PUBLISH_VERSION = '4.5.4.6rc2' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -191,37 +191,37 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -191,37 +191,37 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
191 | .concat(":") | 191 | .concat(":") |
192 | .concat(mCCMS.getSessionId())); | 192 | .concat(mCCMS.getSessionId())); |
193 | 193 | ||
194 | - new Thread(() -> { | 194 | +// new Thread(() -> { |
195 | - if (!Thread.currentThread().isInterrupted()) { | 195 | +// if (!Thread.currentThread().isInterrupted()) { |
196 | - WarplyManager.submitOrder(new CosmoteSubmitOrderRequest() | 196 | + WarplyManager.submitOrder(new CosmoteSubmitOrderRequest() |
197 | - .setCommunicationUuid("") | 197 | + .setCommunicationUuid("") |
198 | - .setUserMsisdn(mSender) | 198 | + .setUserMsisdn(mSender) |
199 | - .setSessionId(mCCMS.getSessionId()) | 199 | + .setSessionId(mCCMS.getSessionId()) |
200 | - .setBusinessService(mCCMS.getBusinessService()) | 200 | + .setBusinessService(mCCMS.getBusinessService()) |
201 | - .setNotificationMessage(mCCMS.getNotificationMessage()) | 201 | + .setNotificationMessage(mCCMS.getNotificationMessage()) |
202 | - .setOfferName(mCCMS.getOfferName()) | 202 | + .setOfferName(mCCMS.getOfferName()) |
203 | - .setProductType(mCCMS.getProductType()) | 203 | + .setProductType(mCCMS.getProductType()) |
204 | - .setProvDuration(mCCMS.getProvDuration()) | 204 | + .setProvDuration(mCCMS.getProvDuration()) |
205 | - .setNoOfRecurrance(mCCMS.getNoOfRecurrance()) | 205 | + .setNoOfRecurrance(mCCMS.getNoOfRecurrance()) |
206 | - .setPrice(mCCMS.getPrice()) | 206 | + .setPrice(mCCMS.getPrice()) |
207 | - .setDiscount(mCCMS.getDiscount()) | 207 | + .setDiscount(mCCMS.getDiscount()) |
208 | - .setVoiceCategory(mCCMS.getVoiceCategory()) | 208 | + .setVoiceCategory(mCCMS.getVoiceCategory()) |
209 | - .setDataCategory(mCCMS.getDataCategory()) | 209 | + .setDataCategory(mCCMS.getDataCategory()) |
210 | - .setMinsValue(mCCMS.getMinsValue()) | 210 | + .setMinsValue(mCCMS.getMinsValue()) |
211 | - .setDataValue(mCCMS.getDataValue()) | 211 | + .setDataValue(mCCMS.getDataValue()) |
212 | - .setProvStepValueMins(mCCMS.getProvStepValueMins()) | 212 | + .setProvStepValueMins(mCCMS.getProvStepValueMins()) |
213 | - .setOfferAudienceLevel(mCCMS.getOfferAudienceLevel()) | 213 | + .setOfferAudienceLevel(mCCMS.getOfferAudienceLevel()) |
214 | - .setUACIOfferTrackingCode(mCCMS.getUACIOfferTrackingCode()) | 214 | + .setUACIOfferTrackingCode(mCCMS.getUACIOfferTrackingCode()) |
215 | - .setOfferCode1(mCCMS.getOfferCode1()) | 215 | + .setOfferCode1(mCCMS.getOfferCode1()) |
216 | - .setScore(mCCMS.getScore()) | 216 | + .setScore(mCCMS.getScore()) |
217 | - .setZone(mCCMS.getZone()) | 217 | + .setZone(mCCMS.getZone()) |
218 | - .setWave(mCCMS.getWave()) | 218 | + .setWave(mCCMS.getWave()) |
219 | - .setValidity(mCCMS.getValidity()) | 219 | + .setValidity(mCCMS.getValidity()) |
220 | - .setTreatmentCode(mCCMS.getTreatmentCode()), | 220 | + .setTreatmentCode(mCCMS.getTreatmentCode()), |
221 | - mSubmitCallback); | 221 | + mSubmitCallback); |
222 | - } | 222 | +// } |
223 | - Thread.currentThread().interrupt(); | 223 | +// Thread.currentThread().interrupt(); |
224 | - }).start(); | 224 | +// }).start(); |
225 | } | 225 | } |
226 | 226 | ||
227 | private void askActivateDialog() { | 227 | private void askActivateDialog() { |
... | @@ -245,13 +245,15 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -245,13 +245,15 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
245 | analyticsEvent.setParameter("successful", "false"); | 245 | analyticsEvent.setParameter("successful", "false"); |
246 | EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | 246 | EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); |
247 | 247 | ||
248 | - mAlertDialogErrorActivating = new AlertDialog.Builder(this) | 248 | + if (!isFinishing()) { |
249 | - .setTitle(R.string.cos_dlg_error_title) | 249 | + mAlertDialogErrorActivating = new AlertDialog.Builder(this) |
250 | - .setMessage(R.string.cos_dlg_error_subtitle) | 250 | + .setTitle(R.string.cos_dlg_error_title) |
251 | - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { | 251 | + .setMessage(R.string.cos_dlg_error_subtitle) |
252 | - dialogPositive.dismiss(); | 252 | + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { |
253 | - }) | 253 | + dialogPositive.dismiss(); |
254 | - .show(); | 254 | + }) |
255 | + .show(); | ||
256 | + } | ||
255 | } | 257 | } |
256 | 258 | ||
257 | private void successActivatingDialog() { | 259 | private void successActivatingDialog() { |
... | @@ -291,17 +293,18 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -291,17 +293,18 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
291 | @Override | 293 | @Override |
292 | public void onSuccess(JSONObject result) { | 294 | public void onSuccess(JSONObject result) { |
293 | int status = result.optInt("status", 2); | 295 | int status = result.optInt("status", 2); |
294 | - runOnUiThread(() -> { | 296 | +// runOnUiThread(() -> { |
295 | - if (status == 1) | 297 | + if (status == 1) |
296 | - successActivatingDialog(); | 298 | + successActivatingDialog(); |
297 | - else | 299 | + else |
298 | - errorActivatingDialog(); | 300 | + errorActivatingDialog(); |
299 | - }); | 301 | +// }); |
300 | } | 302 | } |
301 | 303 | ||
302 | @Override | 304 | @Override |
303 | public void onFailure(int errorCode) { | 305 | public void onFailure(int errorCode) { |
304 | - runOnUiThread(() -> errorActivatingDialog()); | 306 | +// runOnUiThread(() -> errorActivatingDialog()); |
307 | + errorActivatingDialog(); | ||
305 | } | 308 | } |
306 | }; | 309 | }; |
307 | } | 310 | } | ... | ... |
-
Please register or login to post a comment