I have a simple read a txt-file function.
AssetManager mngr = getAssets();
InputStream is = mngr.open("textdb.txt");
It works from my main activity. But if I use the same code in a separate class, getAssets() just return null / crash.
I am unable to find why it only works from the main class.
Any ideas?
Solution:
subClass.ReadSettings(getApplicationContext());
public String[] ReadSettings(Context myContext) {
}