how can forward data form i activity to 3 activity via 2 activity

123
July 13, 2019, at 2:20 PM

I am making my own project but I am stuck.

Getting the information from the user in the first activity is working just fine. But when I try to get those numbers, ints, in the third activity via a second activity, it is showing me the default value.

I am trying it using an Intent, but it is not working.

Intent intent = new Intent(this, active.class);
Intent intent2 = new Intent(this, BMR_Active.class);
intent.putExtra(EXTRA_TEXT_height,height );
intent.putExtra(EXTRA_TEXT_weight,weight);
intent.putExtra(EXTRA_TEXT_age,age);
startActivity(intent);

It is giving me a default value i.e. 0(I have given) in BMR activity then i am going via active activity.

Answer 1

Your putExtra method via intent would work fine, but are you also running putExtra BEFORE starting the third activiy?

The data is first passed from first activity to second activity, then from second activity is passed to third activity using the same method.

Additional Note: In cases like this, I would usually use fragments instead, I would store the data in the activity and fragments will obtain the datas via getActivity(). This will eliminate the needs of multiple passing of data around.

Rent Charter Buses Company
READ ALSO
Java AWS SDK 2.x Async Client - can’t override thread pool executor

Java AWS SDK 2.x Async Client - can’t override thread pool executor

I want to set custom thread pool executor for Async Client (eg

346
Unexpected end-of-input: expected close marker

Unexpected end-of-input: expected close marker

I am attempting to parse JSON using the Jackson v29

1096
How to disable the security certificate check in Java webflux webclient requests

How to disable the security certificate check in Java webflux webclient requests

While making post/get requests through webflux webclient how can ssl check be disabled ?

538
Is there a way to parameterize @Query value in a Spring application?

Is there a way to parameterize @Query value in a Spring application?

I am writing an insert query inside @Query annotation in a Spring application with PostGreSQLSo I am extending CRUD repository inside an interface that I have written

121