I understood that getDir will create a directory if it doesnt exist yet. But I'm crashing on:
File dir= getDir(file,Context.MODE_PRIVATE);
file is of type String. logcat shows:
12-29 21:56:09.456: ERROR/AndroidRuntime(631): java.lang.NullPointerException
12-29 21:56:09.456: ERROR/AndroidRuntime(631): at android.content.ContextWrapper.getDir(ContextWrapper.java:198)
Here's the code:
public class ReportHome extends Application{
public ReportHome(String message, String file){
…some code…
inf(tosend,file);
}
public void inf(String c, String file){
File dir= getDir(file,Context.MODE_PRIVATE);
btw: what is the trick to format more than one line of logcat correctly?