I have a problem that is bugging me. I created a string array in strings.xmlwhich is called bookmark_titles. I want to use it for my alert dialog and populate a list using them, however I can't see name of my array in R.array, it has only those that built in android eg PhoneTypes. How do I reference my array ?
strings.xml
<string name="app_name">Dialogs</string>
<string name="action_settings">Settings</string>
<string-array name="bookmark_titles">
<item>Google</item>
<item>Bing</item>
<item>Gmail</item>
</string-array>
</resources>
FireMissilesDialogFragment
public class FireMissilesDialogFragment extends DialogFragment{
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Books are :");
.setItems(R.array., new DialogInterface.OnClickListener() { ---> can't see reference here
public void onClick(DialogInterface dialog, int which) {
// The 'which' argument contains the index position
// of the selected item
}
});
return builder.create();
}
R.array.bookmark_titles.R.array.bookmark_titles. more info @ developer.android.com/guide/topics/ui/dialogs.html. Also check this developer.android.com/guide/topics/resources/….;frombuilder.setTitle("Books are :").