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
Post a Comment