46

Which is more correct? This:

@Override protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(ID, mId);
}

or this:

@Override protected void onSaveInstanceState(Bundle outState) {
    outState.putLong(ID, mId);
    super.onSaveInstanceState(outState);
}

They both work for me on my Gingerbread device and the Froyo and Ice Cream Sandwich emulators, and I've seen about as many examples saying one way as the other. Does it matter?

4

1 に答える 1

49

キーが衝突しない限り (たとえば、IDAndroid が内部で使用するものと同じであるなど)、2 つのキーは同一です。

于 2012-04-26T22:27:23.267 に答える