First of all sorry about my English because English is my 2nd language.
i am trying to call a method from a activity class to a abstract class which extends from LinearLayout. When the method is called i get a error message such as
ERROR/AndroidRuntime(6068): java.lang.NullPointerException
but i have passing the parameter value to the method and eve though it returning null. is anyone know how to pass the parameter to a activity class from a non activity class?
e.g. Calling methord from activity class (.java)
public void storeData(int data, String filename) {
try {
fileOutPut = openFileOutput(filename, MODE_WORLD_WRITEABLE);
outStreamW = new OutputStreamWriter(fileOutPut );
tmpScore = Integer.toString(data);
osw.append(tmpScore);
osw.flush();
osw.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
to a non activity class (saveNote.java)
i have declared to call the method as below.
fileManager _fileManage = new fileManager();
public void saveNote() {
_fileManage.storeData(200, "savedata.txt");
}
when the saveNote() is called i get ERROR/AndroidRuntime(6068): java.lang.NullPointerException for the line from storeData(int data, String filename) is that fileOutPut = openFileOutput(filename, MODE_WORLD_WRITEABLE);
this mean the parameter is not passing to.
i try to use the Intent way but again because of the class not a activity class it not allowing me to do.
so could you please help me what need to be done to pass the parameter to a non activity class from a activity class.
thank you for take your time to read my thread.


