I'm creating an app that has five activities. I have one class with functions and variables that are used in all five activities. I have created a local variable in each activity that initializes the class like this;
localclass = new globalclass(getResouces());
I'm new to android/java development and was wondering about memoryfootprints and such when I tried something. In the first actvity that gets started, localclass get set as formentioned. I then tried to access this variable from the other activities and did this successfully like this in activity second, third and so on;
localclass = com.firstactivity.localclass;
One of the variables the I use are a reference to application resources. In acticity second on onwards I dont get resources like this;
res = getResources();
but like this;
res = com.firstactivity.localclass.res;
This works as long as variables are static. I also access functions in globalclass the same way.
Is this bad pratice?