呼叫super.onSaveInstanceState(包)第一个或最后?第一个、super、onSaveInstanceState

由网友(印画少年)分享简介:这是更正确的?这:@Override protected void onSaveInstanceState(Bundle outState) {super.onSaveInstanceState(outState);outState.putLong(ID, mId);}或者这样的:or this:@Overri...

这是更正确的?这:

@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);
}

他们我的姜饼设备和升级Froyo和冰淇淋三明治模拟器,和我在两个工作我已经看到了一样多的例子说,一个办法是其他。有没有关系呢?

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?

推荐答案

只要你的键不冲突(例如, ID 是相同的东西的Andr​​oid内部使用),这两个是相同的。

So long as your keys do not collide (e.g., ID being the same as something Android uses internally), the two are identical.

阅读全文

相关推荐

最新文章