I have created the class textViewTable In this class i am saving data related to TextViews That I want to Pass to Next Activity.
public class TextViewTable implements Serializable {
private String FONT;
private String TEXT;
private float TEXT_SIZE;
private ColorStateList TEXT_COLOR;
private float MARGIN_TOP;
private float MARGIN_BOTTOM;
private float MARGIN_LEFT;
private float MARGIN_RIGHT;
private Boolean BoldFlag;
private Boolean ItalicFlag;
private Boolean NormalFlag;
public TextViewTable(){
}
public TextViewTable(String FONT, String TEXT, float TEXT_SIZE, ColorStateList TEXT_COLOR, float MARGIN_TOP, float MARGIN_BOTTOM, float MARGIN_LEFT, float MARGIN_RIGHT, Boolean boldFlag, Boolean italicFlag, Boolean normalFlag) {
    this.FONT = FONT;
    this.TEXT = TEXT;
    this.TEXT_SIZE = TEXT_SIZE;
    this.TEXT_COLOR = TEXT_COLOR;
    this.MARGIN_TOP = MARGIN_TOP;
    this.MARGIN_BOTTOM = MARGIN_BOTTOM;
    this.MARGIN_LEFT = MARGIN_LEFT;
    this.MARGIN_RIGHT = MARGIN_RIGHT;
    BoldFlag = boldFlag;
    ItalicFlag = italicFlag;
    NormalFlag = normalFlag;
}
}
From my activit i want to send ArrayList of Objects of TextViewTable class. I have use the below function to send the ArrayList. But every time I am getting null pointer exception. Please Help to solve this.
public void onClick(View view)
    {
        Intent intent = new Intent(getApplicationContext(), displayImage.class);            
        Bundle bundleObject = new Bundle();
        bundleObject.putSerializable("key", textViewsData);
        intent.putExtras(bundleObject);
        try {
            startActivity(intent);
        }catch (Exception e){
            System.out.println(e);
        }
    }
};

 
     
     
     
     
     
    