Online Course Support

This is the content of the file data/data/com.myuniquename.mygame/shared_prefs/mypref.xml:

Question 3
This is the content of the file data/data/com.myuniquename.mygame/shared_prefs/mypref.xml:

1234
<?xml version=’1.0′ encoding=’utf-8′ standalone=’yes’ ?>
<map>
<int name=”age” value=”23″ />
</map>
What will be the content after the execution of the following code:

1234
SharedPreferences preferences = getSharedPreferences(“mypref”,
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putInt(“age”, 37);
1 point

The content will be unchanged because there is already a preference labeled “age” in the file.

The content will be unchanged because something is missing from the updating code.

The content will be unchanged because the app will crash executing this code because the “age” key is already present in the file.

1234
<?xml version=’1.0′ encoding=’utf-8′ standalone=’yes’ ?>
<map>
<int name=”age” value=”37″ />
</map>

Similar Posts