Add @Result annotation for @OnActivityResult#1058
Add @Result annotation for @OnActivityResult#1058yDelouis merged 3 commits intoandroidannotations:developfrom
Conversation
There was a problem hiding this comment.
Please, add some javadoc on the annotation. See existing annotations to have some examples.
|
You must create a class @OnActivityResult
public void onOneResult(@Result int value, @Result("value") String str) {
...
} |
|
Thank you for your advice. I added some comments and created |
|
Ideally you should create a subclass of |
|
@WonderCsabo @yDelouis while i understand the fact that one handler should only handle one annotation, i wonder if there are not some cases, where it would make sense to handle more. this case here is imho the same situation as in my @ReceiverAction PR. the values/parameters are directly related to the actual annotation that has to be handled, and it has an direct impact on how the generated code should look. in such a case, i would not add the just my 2¢ |
|
Yeah, you have a point, although i do not really think ReceiverAction is |
ReceiverAction has a param annotation too. it is used to map extras like |
|
This is indeed an important decision because it is the first time we deal with a param annotation and it will happen more and more.
|
|
I agree, we should prepare the framework to handle param annotations. We should create a new parent class for these kind of handlers. Also we have to modify |
|
Thanks. We have to update the wiki (list of all annotations and onActivityResult page) about that. @simonz, could you clone the wiki and update it in your fork so that we will be able to pull it ? |
|
I added the doc. |
This PR is implementing #796 which I really wanted to be implemented
@Resultis added to retrieve the values from intentthis is a snippet from a generated code.
extras_was newly declared and one block was added for variable's scope