I\'m very new to android and I\'m following this example.
The code says we need to do these steps to get an dialog box:
AlertDialog.Builder builder =
This article describes how to create an AlertDialog in a Fragment. in Fragments, you can get the corresponding Activity by calling getActivity() method. but in your case i assume you are doing this in an Activity. so you don't have to call getActivity(). just use this
AlertDialog.Builder builder = new AlertDialog.Builder(this);