java - am i allowed to use member variables in static inner class for fragments? -


all static fragments are:

public static class somefragment extends fragment {              int somenum;              string name; } 

are values of somenum , name shared between different instances because class static?

are values of somenum , name shared between different instances because class static?

no. if want them shared, declare members static:

public static class inner  {              static int somenum;              static string name; } 

the static modifier on class valid on nested classes, , job there nested class not inner class (a class that's tied instance of containing class). has nothing whether members of class static.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -