Advertisement
Mechele

Untitled

Mar 3rd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. public void initwallet(){
  2. new GetWalletsTask(getContext()) {
  3.  
  4. @Override
  5. protected void onSuccess(String wallets) throws Exception {
  6. super.onSuccess(wallets);
  7. if (wallets != null) {
  8. super.onSuccess(wallets);
  9. JSONObject wallet_json=new JSONObject(wallets);
  10. TableLayout payment_bottom=(TableLayout)this.findViewById(R.id.payment_bottom);
  11. total_wallets=wallet_json.getJSONArray("total");
  12. for(int i=0;i<total_wallets.length();i++){
  13. JSONObject individual_json=total_wallets.getJSONObject(i);
  14. //Log.d("walletslist",individual_json.getString("currency")+"/"+individual_json.getString("amount"));
  15. TableRow row= new TableRow(getContext());
  16. TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);
  17. row.setLayoutParams(lp);
  18. TextView tv1 = new TextView(getContext());
  19. tv1.setText("SAR");
  20. TextView tv2 = new TextView(getContext());
  21. tv1.setText("");
  22. TextView tv3 = new TextView(getContext());
  23. tv1.setText("100");
  24. row.addView(tv1);
  25. row.addView(tv2);
  26. row.addView(tv3);
  27. payment_bottom.addView(row,i);
  28. }
  29. }
  30. }
  31. }.execute();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement