This code stop working, the only thing I have done is change to Android 4.0.3
public class PrinterFunctions
{
private static SharedPreferences mSetup;
public static final String CSDT = "ComDT";
public static void printFast(){
final Context myContext = null;
loadCompany(myContext);
}
public static void loadCompany(Context context){
mSetup = context.getSharedPreferences(CSDT, Context.MODE_PRIVATE); // NullPointException
//code here
}
}
I get the NullPointerException when executing the above line, this code use to work fine.
Thanks for any help.
Kim
If you’re getting a NPE on that particular line, it probably means the
contextyou are passing toloadCompany()isnull.