Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing a variable in Android application

Tags:

android

I have a json file. So, I was parsed the json file and I want to share jsonarray.length() value all the classes in application. So, what is recommended way to do that??

like image 236
Adnan Avatar asked Jun 29 '26 22:06

Adnan


1 Answers

Option 1: you can set it public static

Option 2: you can store it in a SharePreference

like image 133
stinepike Avatar answered Jul 02 '26 12:07

stinepike