I have weird problem with null checking. I'm using shared preferences where i have stored phonenumber.
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
String number = settings.getString("number1", null);
Before i use that String value i check if it's null
if(number != null){//trying to format number but it gives error: Attempt to invoke virtual method on a null object reference}
In my other app this works fine but in this project it gives me trouble. I dont understand if it has something to do with Services because working app is using background service and this uses JobIntentService.
Can someone tell why this gives error?