Total noob here. Went through Google's developer reference but didn't find enough detail for me to understand. I am trying to make a dialog box appear when hitting an Action Bar item.
I have 2 classes. The first one is only the DialogFragment, using a AlertDialog builder with a positive button and a negative button.
The 2nd class is the Activity, in which I would like to call my DialogFragment and display the dialog, however I when I try to do that under the OnOptionsItemSelected function, using the following code:
DialogFragment newFragment = new CreateWordListDialog(); newFragment.show(getSupportFragmentManager(), "createWordList"); I get a "cannot resolve method" line error on the 2nd line. Where should this line be placed? I must be missing something here.
Fragment.show()asFragmentis not anAlertDialog; you must be imaginingAlertDialog.show()method.