dart
dart copied to clipboard
Is there similar implementation for using intent data in onActivityResult method?
hi there
It is really convenient to startActivity with intent using Dart & Henson. I was wondering if I can pass intent data the similar way when I setResult and finish an Activity, and then get the inject data in onActivityResult method?
If this feature does not exist yet, is it possible to implement with annotation like what Dart & Henson does currently?
Henson is all about building intent. You can use them the way you want.
In the same way, dart let's you map fields of any class to any bundle..
Le dim. 20 nov. 2016 06:31, LoLo [email protected] a écrit :
hi there
It is really convenient to startActivity with intent using Dart & Henson. I was wondering if I can pass intent data the similar way when I setResult and finish an Activity, and then get the inject data in onActivityResult method?
If this feature does not exist yet, is it possible to implement with annotation like what Dart & Henson does currently?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/137, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33Y5mAgjVo1zRhXUZ4mki9mcOtR_Zks5q_9s8gaJpZM4K3dZ- .
Thx~ I read the source code yesterday and realize that I can use Dart.inject(Object o, Bundle source) to implement my need.
But there is still something I am confused.
If I use @InjectExtra in an independent class, it performs well. (Currently I use it in the specific Fragment that receives onActivityResult intent).
But if I write a inner class in the specific Fragment(like class ResultHolder), and use @InjectExtra in it, then the generated code in Henson will encounter an error.
In the Henson class, the generated code is something like XXFragment.ResultHolder$$IntentBuilder, which reports 'can not find symbol' error.
It seems that the compiler can not generate code correctly if I use injection in an inner class. Since at the same time other generated code performs well(XXFragment$$IntentBuilder or XXActivity$$IntentBuilder, they were generated successfully)
I did not read the source code very carefully. If I have leisure time later maybe I can find more details.
Thx a lot :)
Please report the stack trace & the code snippet in a new issue. Thx.
Also, we might not fix it soon and encourage contributions.
Le lun. 21 nov. 2016 08:29, LoLo [email protected] a écrit :
Thx~ I read the source code yesterday and realize that I can use Dart.inject(Object o, Bundle source) to implement my need.
But there is still something I am confused. If I use @InjectExtra in an independent class, it performs well. (Currently I use it in the specific Fragment that receives onActivityResult intent). But if I write a inner class in the specific Fragment(like class ResultHolder), and use @InjectExtra in it, then the generated code in Henson will encounter an error. In the Henson class, the generated code is something like XXFragment.ResultHolder$$IntentBuilder, which reports 'can not find symbol' error. It seems that the compiler can not generate code correctly if I use injection in an inner class. Since at the same time other generated code performs well(XXFragment$$IntentBuilder or XXActivity$$IntentBuilder, they were generated successfully)
I did not read the source code very carefully. If I have leisure time later maybe I can find more details.
Thx a lot :)
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/f2prateek/dart/issues/137#issuecomment-261863179, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33TXNP73WPELbK_GXW1bKw9mVLGOJks5rAUhFgaJpZM4K3dZ- .
Sure. I will write a sample to reproduce this bug. The issue could be close. :)
#138