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 =
getActivity when you use then no need to put new... such as
PendingIntent pi=new PendingIntent.getActivity(this,0,intent,0); //is wrong
user it as :
PendingIntent pi=PendingIntent.getActivity(this,0,intent,0); //is Right code
here we remove new that provide new allocation but here it provide its allocation via getActivity in with in Activity(this).