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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -