I wish to retrieve a unique number every time I start my program (from the internet) and to be able to have access to it in every class without passing it every time. Is this possible?
I believe this must be somehow standard as uniqueID and is used everyhere but I am new to Android and Java.
I wish to retrieve a unique number every time I start my program (from
Share
Here is a previous solution that might be useful… Android global variable
Alternatively, you could declare a public static String, set the value of the String in the first class, and then each access to this String from other classes would return this same value.
For example…
Class 1…
Class 2, 3, 4…, where you want to get the value that was already set…