title: java.lang.ClassCastException Adapter cast to an Activity
body: <p>I have a function like this</p>
  
  <pre><code>  private void goToSalesActList(View view) {
      CustomerActivity ca = (CustomerActivity)view.getTag();
      Intent intent = new Intent(this, SalesActListActivity.class);
      Bundle bundle = new Bundle();
      bundle.putParcelable(Const.OBJ_USER, user);
      bundle.putParcelable("CustomerListActivity", ca);
      intent.putExtras(bundle);
      startActivity(intent);
    }
  </code></pre>
  
  <p>i have an error like at blockquote on that line</p>
  
  <blockquote>
    <p>java.lang.ClassCastException: com.kreators.nvmobile.dashboard.AdapterSalesAct$ViewHolder cannot be cast to com.kreators.nvmobile.dashboard.SalesActActivity$CustomerActivity</p>
  </blockquote>
  
  <pre><code>CustomerActivity ca = (CustomerActivity)view.getTag();
  </code></pre>
  
  <p>Simply, I want to parcelable some data on my class function CustomerActivity to  intent SalesActListActivity but i have error like this. Can anyone help me ?
  At least, here is my CustomerActivity function</p>
  
  <pre><code>static class CustomerActivity implements Parcelable {
  public int id, qty, AROD, HAVE, Visit;
  public String code, name, sales, salesname, target, amt, psi;
  
  public CustomerActivity(JSONObject o) {
    try {
      id = o.getInt("CustId");
      code = o.getString("CustCode");
      name = o.getString("CustDesc");
      salesname = o.getString("Salesname");
      sales = o.getString("Sales");
      target = o.getString("SITarget");
      amt = o.getString("SIAmt");
      psi = o.getString("persenPSI");
      qty = o.getInt("SOQty");
      AROD= o.getInt("AROD");
      HAVE= o.getInt("HAVE");
      Visit= o.getInt("Visit");
    } catch (JSONException e) {}
  }
  
  protected CustomerActivity(Parcel in) {
    id = in.readInt();
    qty = in.readInt();
    code = in.readString();
    name = in.readString();
    salesname = in.readString();
    sales = in.readString();
    target = in.readString();
    amt = in.readString();
    psi = in.readString();
    AROD = in.readInt();
    HAVE = in.readInt();
    Visit = in.readInt();
  }
  
  public static final Creator&lt;CustomerActivity&gt; CREATOR = new Creator&lt;CustomerActivity&gt;() {
    @Override
    public CustomerActivity createFromParcel(Parcel in) {
      return new CustomerActivity(in);
    }
  
    @Override
    public CustomerActivity[] newArray(int size) {
      return new CustomerActivity[size];
    }
  };
  
  @Override
  public int describeContents() {
    return 0;
  }
  
  @Override
  public void writeToParcel(Parcel parcel, int i) {
    parcel.writeInt(id);
    parcel.writeInt(qty);
    parcel.writeString(code);
    parcel.writeString(name);
    parcel.writeString(salesname);
    parcel.writeString(sales);
    parcel.writeString(target);
    parcel.writeString(amt);
    parcel.writeString(psi);
    parcel.writeInt(AROD);
    parcel.writeInt(HAVE);
    parcel.writeInt(Visit);
  }
  </code></pre>
  
  <p>}</p>
  
  <blockquote>
    <p>java.lang.ClassCastException: com.kreators.nvmobile.dashboard.AdapterSalesAct$ViewHolder cannot be cast to com.kreators.nvmobile.dashboard.SalesActActivity$CustomerActivity
                          at com.kreators.nvmobile.dashboard.SalesActActivity.goToSalesActList(SalesActActivity.java:210)
                          at com.kreators.nvmobile.dashboard.SalesActActivity.access$000(SalesActActivity.java:33)
                          at com.kreators.nvmobile.dashboard.SalesActActivity$1.onItemClick(SalesActActivity.java:256)
                          at android.widget.AdapterView.performItemClick(AdapterView.java:305)
                          at android.widget.AbsListView.performItemClick(AbsListView.java:1146)
                          at android.widget.AbsListView$PerformClick.run(AbsListView.java:3053)
                          at android.widget.AbsListView$3.run(AbsListView.java:3865)
                          at android.os.Handler.handleCallback(Handler.java:739)
                          at android.os.Handler.dispatchMessage(Handler.java:95)
                          at android.os.Looper.loop(Looper.java:135)
                          at android.app.ActivityThread.main(ActivityThread.java:5345)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at java.lang.reflect.Method.invoke(Method.java:372)
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)</p>
  </blockquote>
  
  <p>that is my error message</p>
  
  <p>Sorry my grammar is bad and I'm newbie
  谢谢</p>