Can';t使用AspectJ为Android对话框创建方面

Can';t使用AspectJ为Android对话框创建方面,android,dialog,aop,aspectj,android-alertdialog,Android,Dialog,Aop,Aspectj,Android Alertdialog,我已经能够在视图中找到OnClickListeners: @After("execution(* android.widget.AdapterView.OnItemClickListener.onItemClick(..))") 以及有关活动的活动: @After("execution(* android.app.Activity.onResume(..))") 但由于某些原因,我似乎无法抓住AlertDialog、Dialog甚至Dialog.Builder中的任何内容。我想在显示对话框时

我已经能够在视图中找到OnClickListeners:

@After("execution(* android.widget.AdapterView.OnItemClickListener.onItemClick(..))")
以及有关活动的活动:

@After("execution(* android.app.Activity.onResume(..))")
但由于某些原因,我似乎无法抓住AlertDialog、Dialog甚至Dialog.Builder中的任何内容。我想在显示对话框时添加建议

不起作用:

@After("execution(* android...AlertDialog.show(..))")
@After("execution(* android.app.ProgressDialog.show(..))")
@After("execution(* *..DialogInterface+.*(..) || * *..Dialog+.*(..))")
不起作用:

@After("execution(* android...AlertDialog.show(..))")
@After("execution(* android.app.ProgressDialog.show(..))")
@After("execution(* *..DialogInterface+.*(..) || * *..Dialog+.*(..))")
不起作用:

@After("execution(* android...AlertDialog.show(..))")
@After("execution(* android.app.ProgressDialog.show(..))")
@After("execution(* *..DialogInterface+.*(..) || * *..Dialog+.*(..))")

我会想,如果我能为视图和活动编写方面,我也能为AlertDialogs做同样的事情。我仍然认为是我对AspectJ的有限知识阻碍了我在这里的运气?

问题是AspectJ只能应用于您编写的代码。因此,它确实可以应用于您自己的活动和侦听器实现,但如果您自己不创建Dialog的子类,它将使用用户设备上可用的类,而不会应用您的建议