Difference in onCreate(Bundle) parameter

Asked

Viewed 197 times

2

I had a doubt here reading Ricardo Lecheta’s book, android, in which I saw no explanation neither in the book, nor found on the internet. Some examples use the onCreate function like this: onCreate(Bundle Icicle) and other onCreate(Bundle savedSInstanceState). Could someone explain the difference between the two parameters?

  • The two are of the same type, so, equal, now the difference is in the spelling that can symbolize something in programming, something proper or following some rule

  • 1

    So I use either one of the two that won’t affect anything, correct?

  • 1

    Yes, because, what counts is Bundle the name of the variable does not matter in this aspect. Now it can symbolize how I said a rule or something of his own to know the difference in the code or something like that

  • 1

    Got it, thanks man.

1 answer

1


The only difference is that the onCreate(Bundle Icicle) method is from older versions of the Android SDK, while onCreate(Bundle savedSInstanceState) is in newer versions.

Note the following: in both versions, the input parameter is a Bundle, and the only thing that changed was the name of the "variable" given to that input parameter. I mean, they’re the same thing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.