title: Cannot Update Value Displayed in the Card - Cardslib Library for Android
body: <p>I am implementing the CardWithList design from Cardslib library from Github. Library Link : <a href="https://github.com/gabrielemariotti/cardslib" rel="nofollow">Cardslib Github</a></p>
  
  <p>The problem im facing is that i cannot update the card values 
  Here is the Code
  GetStat.java</p>
  
  <pre><code>import android.content.Context;
  import android.os.AsyncTask;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import org.json.JSONObject;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import it.gmariotti.cardslib.library.internal.Card;
  import it.gmariotti.cardslib.library.internal.CardHeader;
  import it.gmariotti.cardslib.library.prototypes.CardWithList;
  
  public class GetStat extends CardWithList {
  long musers;
  long mclicks;
  long mbanner;
  long mptc;
  long mtickets;
  double mwithdraw;
  double mfunds;
  double minvested;
  CommonGateway usersobj;
  
  private void updateResult(String jsonResp) {
  
      try {
          JSONObject jsonResponse = new JSONObject(jsonResp);
          musers = jsonResponse.getLong("users");
          usersobj.numbers=String.valueOf(musers);
          Toast.makeText(getContext(), "Complete"+musers, Toast.LENGTH_SHORT).show();
          mclicks = jsonResponse.getLong("clicks");
          mbanner = jsonResponse.getLong("banner");
          mptc = jsonResponse.getLong("ptc");
          mtickets = jsonResponse.getLong("tickets");
  
          mwithdraw = jsonResponse.getDouble("withdraw");
          mfunds = jsonResponse.getDouble("funds");
          minvested = jsonResponse.getDouble("invested");
  
      } catch (Exception e) {
  
      }
  }
  
  public class SimplePoster extends AsyncTask&lt;Void, Void, String&gt; {
      @Override
      protected void onPostExecute(String s) {
          updateResult(s);
  
  
      }
  
      @Override
      protected String doInBackground(Void... params) {
          Webb webb = Webb.create();
          String response = webb.post("http://example.net/api/?action=site_admin&amp;type=json&amp;api=gbh&amp;sub=stats")
                  .ensureSuccess()
                  .asString().getBody();
          return response;
      }
  }
  
  public GetStat(Context context,Values v) {
      super(context);
  
  }
  
  @Override
  protected CardHeader initCardHeader() {
      CardHeader header = new CardHeader(getContext(), R.layout.header);
      header.setTitle("Statistics"); //should use R.string.
      return header;
  }
  
  @Override
  protected void initCard() {
  
  }
  
  @Override
  protected List&lt;ListObject&gt; initChildren() {
  
      //Init the list
      List&lt;ListObject&gt; mObjects = new ArrayList&lt;ListObject&gt;();
       usersobj= new CommonGateway(this);
  
     usersobj.SetData("Users", R.drawable.usersico,musers);
      mObjects.add(usersobj);
  
      return mObjects;
  
  }
  
  @Override
  public View setupChildView(int i, ListObject listObject, View view, ViewGroup viewGroup) {
  
      TextView title = (TextView) view.findViewById(R.id.cardtitle);
      ImageView icon = (ImageView) view.findViewById(R.id.cardimage);
      TextView numbers = (TextView) view.findViewById(R.id.cardnumbers);
  
      CommonGateway gatewayObject= (CommonGateway)listObject;
      icon.setImageResource(gatewayObject.icon);
      title.setText(gatewayObject.title);
      numbers.setText(gatewayObject.numbers);
  
      return view;
  }
  
  
  
  @Override
  public int getChildLayoutId() {
      return R.layout.cardmain;
  }
  public class CommonGateway extends DefaultListObject {
  
      String title="null";
      String numbers="null";
      int icon=0;
      public CommonGateway(Card parentCard) {
          super(parentCard);
  
  
      }
      public void SetData(String title,int icon,long numbers)
      {
          this.title=title;
          this.icon=icon;
          this.numbers=String.valueOf(numbers);
      }
      public void SetData(String title,int icon,double numbers)
      {
          this.title=title;
          this.icon=icon;
          this.numbers=String.valueOf(numbers);
      }
  }
  }
  </code></pre>
  
  <p>i want to update card values after the asynctask completes</p>