I have a method that scans the position and gets called on every activity I have, everytime an actions trigger I need to show an alertDialog, this is the code:

AlertDialog.Builder builder = new AlertDialog.Builder(mMainActivity.this);
                        builder.setMessage("test")
                           .setCancelable(false)
                           .setPositiveButton("go", new DialogInterface.OnClickListener() {
                               public void onClick(DialogInterface dialog, int id) {
                                   Intent intent = new Intent(mMainActivity.this,LocationDetails.class);
                                    intent.putExtra("placeId",1);
                                    startActivity(intent);

                               }
                           })
                           .setNegativeButton("cancel", new DialogInterface.OnClickListener() {
                               public void onClick(DialogInterface dialog, int id) {

                                    dialog.cancel();
                               }
                           });
                        AlertDialog alert = builder.create();
                        alert.show();


But How can I create the alert on the current activity? Because now it only gets created on AlertDialog.Builder(mMainActivity.this);


Question: Can we activate syntax highlighting for code blocks based on the question's tags?
Answer: This is now enabled, but there's no default language set, which means you'll need to provide hinting as to what scheme should be used for it to show. 

On a few tags, by tag kind of makes sense for obvious reasons. However, in others .. it wouldn't, depending on the content of the post. In order to stay consistent, we're just allowing manual hints as needed, which is a little less confusing to the non-ninjas posting their first few contributions.