android - How to do an inter-type injection on classes that have methods with a certain annotation? -


to give context: using aspectj android projects, , i've written @background annotation apply methods cannot block main ui thread. annotation being intercepted pointcut , around advice takes care of running code in background thread , dealing network errors , user notification.

what next automatically provide reload button on menu activities have such background methods has done overriding method following signature: public boolean oncreateoptionsmenu(menu menu);

activities don't background stuff don't need have menu, , thus, don't override method.

so, there way make aspectj override method in classes have (at least) method particular annotation ?

or there more elegant solution ?

thanks, carlos.

take @ hasmethod type pattern (you can see bug report usages). should able add marker interface types have method(s) required signature , introduce oncreateoptionsmenu it.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -