Home > Mobile >  Android new variable to the global access
Android new variable to the global access

Time:09-30

OkHttpClient client=new OkHttpClient ()
New a OkHttpClient, variable called client,
How can access to, in the other events or screen to solve

CodePudding user response:

Public static OkHttpClient client=new OkHttpClient ();

CodePudding user response:

Only request access to, a public static variable is not to go, but it certainly can't write, so have to see what is your specific needs

CodePudding user response:

Writes Application derived classes, and will never be destroyed

CodePudding user response:

Good in Application to new objects and then write a get method returns a value object is new, so it can be used in full screen
  • Related