Showing
3 changed files
with
26 additions
and
30 deletions
No preview for this file type
| ... | @@ -503,47 +503,42 @@ public static void showExitDialog(final PoolExitDialogListener exitDialogListene | ... | @@ -503,47 +503,42 @@ public static void showExitDialog(final PoolExitDialogListener exitDialogListene |
| 503 | 503 | ||
| 504 | @Override | 504 | @Override |
| 505 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { | 505 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 506 | + super.onActivityResult(requestCode, resultCode, data); | ||
| 506 | PoolSdkHelper.onActivityResult(requestCode, resultCode, data); | 507 | PoolSdkHelper.onActivityResult(requestCode, resultCode, data); |
| 507 | } | 508 | } |
| 508 | 509 | ||
| 509 | @Override | 510 | @Override |
| 510 | public void onConfigurationChanged(Configuration newConfig) { | 511 | public void onConfigurationChanged(Configuration newConfig) { |
| 511 | - // TODO Auto-generated method stub | ||
| 512 | super.onConfigurationChanged(newConfig); | 512 | super.onConfigurationChanged(newConfig); |
| 513 | PoolSdkHelper.onConfigurationChanged(newConfig); | 513 | PoolSdkHelper.onConfigurationChanged(newConfig); |
| 514 | } | 514 | } |
| 515 | 515 | ||
| 516 | @Override | 516 | @Override |
| 517 | protected void onSaveInstanceState(Bundle outState) { | 517 | protected void onSaveInstanceState(Bundle outState) { |
| 518 | - // TODO Auto-generated method stub | ||
| 519 | super.onSaveInstanceState(outState); | 518 | super.onSaveInstanceState(outState); |
| 520 | PoolSdkHelper.onSaveInstanceState(outState); | 519 | PoolSdkHelper.onSaveInstanceState(outState); |
| 521 | } | 520 | } |
| 522 | 521 | ||
| 523 | @Override | 522 | @Override |
| 524 | protected void onRestoreInstanceState(Bundle savedInstanceState) { | 523 | protected void onRestoreInstanceState(Bundle savedInstanceState) { |
| 525 | - // TODO Auto-generated method stub | ||
| 526 | super.onRestoreInstanceState(savedInstanceState); | 524 | super.onRestoreInstanceState(savedInstanceState); |
| 527 | PoolSdkHelper.onRestoreInstanceState(savedInstanceState); | 525 | PoolSdkHelper.onRestoreInstanceState(savedInstanceState); |
| 528 | } | 526 | } |
| 529 | 527 | ||
| 530 | @Override | 528 | @Override |
| 531 | public void onWindowFocusChanged(boolean hasFocus) { | 529 | public void onWindowFocusChanged(boolean hasFocus) { |
| 532 | - // TODO Auto-generated method stub | ||
| 533 | super.onWindowFocusChanged(hasFocus); | 530 | super.onWindowFocusChanged(hasFocus); |
| 534 | PoolSdkHelper.onWindowFocusChanged(hasFocus); | 531 | PoolSdkHelper.onWindowFocusChanged(hasFocus); |
| 535 | } | 532 | } |
| 536 | 533 | ||
| 537 | @Override | 534 | @Override |
| 538 | public void onWindowAttributesChanged(LayoutParams params) { | 535 | public void onWindowAttributesChanged(LayoutParams params) { |
| 539 | - // TODO Auto-generated method stub | ||
| 540 | super.onWindowAttributesChanged(params); | 536 | super.onWindowAttributesChanged(params); |
| 541 | PoolSdkHelper.onWindowAttributesChanged(params); | 537 | PoolSdkHelper.onWindowAttributesChanged(params); |
| 542 | } | 538 | } |
| 543 | 539 | ||
| 544 | @Override | 540 | @Override |
| 545 | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { | 541 | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { |
| 546 | - // TODO Auto-generated method stub | ||
| 547 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); | 542 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); |
| 548 | PoolSdkHelper.onRequestPermissionsResult(requestCode, permissions, grantResults); | 543 | PoolSdkHelper.onRequestPermissionsResult(requestCode, permissions, grantResults); |
| 549 | } | 544 | } |
| ... | @@ -561,6 +556,9 @@ public static void showExitDialog(final PoolExitDialogListener exitDialogListene | ... | @@ -561,6 +556,9 @@ public static void showExitDialog(final PoolExitDialogListener exitDialogListene |
| 561 | 556 | ||
| 562 | ### 2.13、获取渠道包标识(可选) ### | 557 | ### 2.13、获取渠道包标识(可选) ### |
| 563 | ``` | 558 | ``` |
| 559 | + 如果需要在调用初始化接口之前获取请先调用 | ||
| 560 | + PoolSdkConfig.readPoolSdkConfigData(context); | ||
| 561 | + | ||
| 564 | 对应打包工具的 渠道号 | 562 | 对应打包工具的 渠道号 |
| 565 | 接口名称:PoolSdkHelper.getGameChannelId() | 563 | 接口名称:PoolSdkHelper.getGameChannelId() |
| 566 | 接口说明:获取在企业平台配置的渠道标识,返回类型为 String | 564 | 接口说明:获取在企业平台配置的渠道标识,返回类型为 String |
| ... | @@ -685,30 +683,28 @@ PoolSdkHelper.paymentSuccess(AppActivity.this, orderIds.toString()); | ... | @@ -685,30 +683,28 @@ PoolSdkHelper.paymentSuccess(AppActivity.this, orderIds.toString()); |
| 685 | 683 | ||
| 686 | 代码示例: | 684 | 代码示例: |
| 687 | ```java | 685 | ```java |
| 688 | -if(paramCustom == null || paramCustom.length() <= 0) | 686 | + if (paramCustom == null || paramCustom.length() <= 0) { |
| 689 | -{ | 687 | + PoolSdkLog.logError("paysuccess data error :" + paramCustom); |
| 690 | -PoolSdkLog.logError("paysuccess data error :" + paramCustom); | 688 | + return; |
| 691 | -return; | 689 | + } |
| 692 | -} | 690 | + |
| 693 | - | 691 | + try { |
| 694 | -try { | 692 | + PoolSdkLog.logInfo("paySuccess:" + paramCustom); |
| 695 | -PoolSdkLog.logInfo("paySuccess:" + paramCustom); | 693 | + JSONArray jsonArray = new JSONArray(paramCustom); |
| 696 | -JSONArray jsonArray = new JSONArray(paramCustom); | 694 | + StringBuilder orderIds = new StringBuilder(); |
| 697 | -StringBuilder orderIds = new StringBuilder(); | 695 | + int length = jsonArray.length(); |
| 698 | -int length = jsonArray.length(); | 696 | + for (int i = 0; i < length; i++) { |
| 699 | -for (int i = 0; i < length; i++) { | 697 | + JSONObject jb = jsonArray.getJSONObject(i); |
| 700 | -JSONObject jb = jsonArray.getJSONObject(i); | 698 | + String orderId = jb.getString("orderId"); |
| 701 | -String orderId = jb.getString("orderId"); | 699 | + orderIds.append(orderId); |
| 702 | -orderIds.append(orderId); | 700 | + if (i != length - 1) {//最后一项不加分割符 |
| 703 | -if(i != length -1) {//最后一项不加分割符 | 701 | + orderIds.append(","); |
| 704 | -orderIds.append(","); | 702 | + } |
| 705 | -} | 703 | + } |
| 706 | -} | 704 | + PoolSdkHelper.paymentSuccess(AppActivity.this, orderIds.toString()); |
| 707 | -PoolSdkHelper.paymentSuccess(AppActivity.this, orderIds.toString()); | 705 | + } catch (JSONException e) { |
| 708 | -} catch (JSONException e) { | 706 | + e.printStackTrace(); |
| 709 | -// TODO Auto-generated catch block | 707 | + } |
| 710 | -e.printStackTrace(); | ||
| 711 | -} | ||
| 712 | ``` | 708 | ``` |
| 713 | 709 | ||
| 714 | # 6.游戏使用多dex打包需要注意的点 | 710 | # 6.游戏使用多dex打包需要注意的点 | ... | ... |
No preview for this file type
-
Please register or login to post a comment