• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

onActivityResult not working?

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdi partners...

I am working on an app and I am not sure why somethings are not working please assist:

I have added a Image cropper Library to my  project: com.theartofdev.edmodo:android-image-cropper

and I followed a tutorial (https://youtu.be/X7YQy3ayjOg) but I seem to have a problem:

In my code, the onActivityResult is not seeming to run? and I am not sure why:
here is my code:


Could anyone please tell me why it isn't working? or even just why the requestCode is always false???
 
Rancher
Posts: 3410
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the call to the startActivityForResult method?

Add a print statement that prints the values of the args passed to the  onActivityResult method so you can see when it is called and what the args were.
 
Ben van Jaarsveld
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is what I found funny from the tutorial on youtube...

There is nowhere where it was called....

So I am sorry but i do not know how to answer you...I followed the tutorial....

it has a ???

...............................
just want to add... the tutorial didn't require an onClickListener on the button... just for me to specify in the "onClick" of the xml file.... but it didn't want to work then...
 
Norm Radder
Rancher
Posts: 3410
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to read about the methods: onActivityResult and startActivityForResult and setResult and how they are used.

The startActivityForResult method "calls" another Activity.  When that Activity ends, it returns control to the onActivityResult method with some results and the request code by calling the setResult method.
 
Ranch Foreman
Posts: 376
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you just clone down this project from github and use it?

https://github.com/ArthurHub/Android-Image-Cropper
 
Ben van Jaarsveld
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Randy Tong wrote:Why don't you just clone down this project from github and use it?

https://github.com/ArthurHub/Android-Image-Cropper



Thanks for the suggestion but, I am getting too many errors, that I can't see why I am getting them...I will look for another solution
 
Randy Tong
Ranch Foreman
Posts: 376
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ben van Jaarsveld wrote:
Thanks for the suggestion but, I am getting too many errors, that I can't see why I am getting them...I will look for another solution


I cloned and use, no errors.
What errors are you getting ?
 
Ben van Jaarsveld
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Randy Tong wrote:
I cloned and use, no errors.
What errors are you getting ?



Thanks ... you forced me to look at my code again... made my own errors... it is working now...

Thanks...solved
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!