Android: Placing a random item from a String Array in to Notifications
问题 I want my app to be able to pick a random item from this string array: <string-array name="quote_list"> <item>Quote 1 </item> <item>Quote 2 </item> <item>Quote 3</item> </string-array> And send the item off in a notification to the user. (Will be at a time chosen by user, using alarmmanager) I believe I can generate a random item using the following method. How to get a random value from a string array in android? Would I start off with something like this? NotificationCompat.Builder mBuilder