Can i initialize object in my first activity and you it in all activity???
public class Calc{
int x;
int y;
public Calc(int x, int y) {
th
make
public class Calc implements Serializable {
int x;
int y;
public Calc(int x, int y) {
this.x = x;
this.y = y;
}
public int sum() {
return x + y;
}
}
and
When you start your PreviewActivity
Intent intent = new Intent(mContext, PreviewActivity .class);
intent.putParcelableArrayListExtra("data",c);
startActivity(intent);
and in your PreviewActivity do this
Calc c=(Calc ) getIntent().getSerializableExtra("data");