Passing Object Through Parcelable but Getting NULL Object
<blockquote>
  <p>I am triyn to implement Parcle data and send it to some other class through Intent but getting NULL object I am new in Android there may be some stupid mistake if yes sorry for that ....
  Cretaed object and Intent passed on button click </p>
</blockquote>

<pre><code>    public class ParceableExampleActivity extends Activity implements  View.OnClickListener {


    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button button1 = (Button)findViewById(R.id.button1);
        button1.setOnClickListener(this);

    }
    @Override
    public void onClick(View v) {
        switch(v.getId()){
        case R.id.button1:
             ParcelData p = new ParcelData();
             p.setFirstName("Kumar");
             p.setAddedBy(3);
            Intent n = new Intent(this,ResultActivity.class);
            n.putExtra("data", p);
            startActivity(n);

        }

    }
}
</code></pre>

<blockquote>
  <p>Parceldata which implements pacelclass </p>
</blockquote>

<pre><code> public class ParcelData implements Parcelable {

    private String firstName ;
    private int addedBy ;
    //private UUID guid ;

    private static final String TAG = "TEST" ;
    public ParcelData() {
        firstName=null ;
        addedBy=0;
    //  guid=null;
    }

    public String getFirstName() {
        return firstName;
    }
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    public int getAddedBy() {
        return addedBy;
    }
    public void setAddedBy(int addedBy) {
        this.addedBy = addedBy;
    }

    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
        public Parcelable createFromParcel(Parcel in) {
                       return new ParcelData(); 
        }

        @Override
        public Parcelable[] newArray(int size) {
             return new Parcelable[size];
        }
    } ;



    public void writeToParcel(Parcel dest, int flags) {
        Log.v(TAG, "writeToParcel..."+ flags);

        dest.writeString(firstName);
        dest.writeInt(addedBy);


    }

    public void ParcelData(Parcel in){
        readFromParcel(in);
    }

    @Override
    public int describeContents() {
        // TODO Auto-generated method stub
        return 0;
    }

     private void readFromParcel(Parcel in) {

         firstName= in.readString();
         addedBy= in.readInt();
     }

    }
</code></pre>

<blockquote>
  <p>Receiving the Object </p>
</blockquote>

<pre><code>public class ResultActivity extends Activity implements  View.OnClickListener {



        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            Button button1 = (Button)findViewById(R.id.button2);
            button1.setOnClickListener(this);
        }
        @Override
        public void onClick(View v) {
            switch(v.getId()){
            case R.id.button2:
                Bundle b = getIntent().getExtras();
                ParcelData result_p=b.getParcelable("data");
                Log.v("RESULT", "result of Parcel..."+ result_p.getFirstName());
                Log.v("RESULT", "result of Parcel..."+ result_p.getAddedBy());

            }

        }
    }
</code></pre>

<blockquote>
  <p>but the result of the logs are NULL </p>
</blockquote>
