I currently have the current aspect
@Aspect
public class ActivityShowingAspect {
private static final String POINTCUT_METHOD =
"execution(@nz.co.kevinsahandsomedevil.android.myaccount.aspect.ActivityMustBeShowing * *(..))";
@Pointcut(POINTCUT_METHOD)
public void methodAnnotatedWithActivityShowing() {
}
@Around("methodAnnotatedWithActivityShowing()")
public Object weaveJoinPoint(ProceedingJoinPoint joinPoint) throws Throwable {
Activity activity = // code to retrieve the calling activity, joinPoint.getTarget() or whatever
Object result = null;
if(!activity.isFinishing()) {
result = joinPoint.proceed();
} else {
result = // do something else
}
return result;
}
}
I'd like to know how to determine the calling Activity
from within the Aspect.