kolek
kolek

Reputation: 3940

Return two floats to previous activity

I am using startActivityForResult to show new activity(map Activity). In new activity i use setResult.

How I can return two float values to previous activity (longtitude,latitude from map Activity) ?

Is it possible ?

Upvotes: 1

Views: 95

Answers (1)

A. AMAIDI
A. AMAIDI

Reputation: 6849

you can use the following code

Intent intent = new Intent();
intent.putExtra("latitude", latitude);
intent.putExtra("longitude", longitude);
setResult(RESULT_OK, intent);

you can then retrieve them from previous activity

Upvotes: 3

Related Questions