I need show AlertDialog from service and I'm using code on service:
public void onCreate() {
Intent i=new Intent(getApplicationContext(), GroupActivity.class);
AlertDialog.Builder alert=new Builder(getApplicationContext());
alert.setTitle("Success!");
alert.setMessage("Hien tai");
alert.setPositiveButton("Success", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
alert.show();
};
But the code throw execption. How to do that?