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
How can i pass it to another activity or how can i make it share with other activity
Just use Intent so:
intent.putExtra("calc" new Calc(3, 4));
for passing this Object
when you want to start another Activity
.
Then in your second Activity
just call:
Calc c = getIntent().getParcelableExtra("calc"); // getSerializableExtra("calc");
And your Calc
class have to implement Parcelable
or Serializable
public class Calc implements Parcelable {
...
}