define global params in android -


want define global const parameters (arrs , int etc..) in 1 java file activity can reach them , use them.
tried define them globaly in activity , import activity isn't work.

in level_1_general:

    public int number_of_words=50; 

the import:

import com.example.freeenglish.level1_general; 

what right way that?

a common pattern create costants class private constructor in put every costants app need. eg

public class costants {    public static final int number_of_words=50;   private costants() {} } 

then able access variable with

costants.number_of_words 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -