Question: I know double should not be compared by == operator directly, but how about if I define an initial value as 0.0?eg:

```
double a=0.0;
double b=
.
.
.

```

If a is not modified, does a\*b==0 always true?

Answer: 
```
if (!inputGuardian1.getText().toString().matches("")){
            Log.i("Putting text", "in sp");
          if(sharedPreferences != null){
            sharedPreferences.edit().putString("Guardian 1", guardian1).apply();
            Log.i("Putting text", "passed");
           }else{
            sharedPreferences = mContext.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
            sharedPreferences.edit().putString("Guardian 1", guardian1).apply();
           }
        }

```
Because you have to do sharedPreferences like this:

```
SharedPreferences sharedPref = getSharedPreferences(
                getString(R.string.preference_file_key), Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();

```

and then `editor.putString(`...

and then `editor.apply()`