Preferences issues. There are 2 activities (classes). In one, the key "number" is 0, and in the other (in which I worked with this key) = 2. (I unload the keys when starting the program). The code is the same and in the same places (OnCreate), only the variable names are different:
notes = getPreferences(MODE_WORLD_WRITEABLE); Editor ed = notes.edit(); textView1.setText(String.valueOf(notes.getInt("number", 0)));