I know
String value= value;
Intent i = new Intent(this, NextActivity.class);
i.putExtra("value",value + "");
startActivity(i)
and in NextActivity
values = getIntent().getStringExtra("value");
is used to pass the value and get value.. can any one pleaese help me how to pass the long value...
I know we can get the long value through
getIntent().getLongExtra("");
can anyone help me how to pass the value ' putExtra ' to my knowledge is used to pass string value..
For send data
i.putExtra("key", long value);
For get Intent value in next Activity
getIntent().getLongExtra("key", 0);
Here 0
denotes default value if you not want putExtra from first Activity then in Next Activity it will take default value as 0
.
for long values also, you can use:
i.putExtra(String name, long value);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With