performance - Android - Using the Same Variables in Multiple Acitivies -


this question has answer here:

in have set of variables used in 90% of code. solve this, i'm passing through activities using intent , putting extra:

intent = new intent(getapplicationcontext(), nextactivity.class); intent.putextra("token",getintent().getextras().getstring("token")); startactivity(intent); 

the problem is: since bunch of variables code little bit messy , need write same code lines multiple times, seems stupid.

so, question if there ways of doing such global variable can read activities (which dirty solution).

thank you, pedro.

save variable values sharedpreferences can access wherever want within application.


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -