Android comes with lots of system resources (android.R
) that can be used to save you time and make your application lighter.
For example, I recently discovered that Android provides localized strings for Yes (android.R.string.yes
), No (android.R.string.no
), Cancel (android.R.string.cancel
) and Ok (android.R.string.ok
), among other strings.
What other system resources do you recommend using? Or is there a reason to avoid using system resources?
Edit: As noted by Tomas, some of this resources might not produce the results you would expect (particularly, android.R.string.yes/no
returns OK/Cancel
instead of Yes/No
, as reported here). For greater control, you can copy system resources from the Android source code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…