Alex Rivera | Logout

naming convention for passing data through extras in android

Asked 2010-12-13T21:46:16.870
29

when passing extras such as Intent.putExtra("myName", myName), what's the convention for the name of the extra?

ie: if passing data between two activities, both would put/extract data under the id "myName", but should I just hardcode "myName" everywhere, or keep the value in the R.values.string?

Edit
Report

1 Answer

0

The only thing I saw in documentation is that extra keys should start from package name. However I do not fully follow this and the app works Ok so far.

I would prefer to use R.string.some_key within the code just to have it clean and dry.

answered 2010-12-13T21:51:55.137

Your Answer