• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Uploading an image in WebView

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys, Am trying to upload an image from my android phone and view it inside a webView but after I select an Image in my gallery It wouldn't show on the WebView
Here is my Code
 
Saloon Keeper
Posts: 5564
143
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when the code is run? Which lines of code are or are not being executed? What are the values of all involved variables and subexpressions?

This code looks suspect:

resultCode == IMG_REQUEST && resultCode == RESULT_OK


If it is not actually wrong, at least the code has duplicate constant values.
 
Olajire Abdullahi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:What happens when the code is run? Which lines of code are or are not being executed? What are the values of all involved variables and subexpressions?

This code looks suspect:

resultCode == IMG_REQUEST && resultCode == RESULT_OK


If it is not actually wrong, at least the code has duplicate constant values.



It is not wrong and the App works fine without crash or Error
 
Rancher
Posts: 3368
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first condition in the if test should probably be of the requestCode not the resultCode.  I'm assuming the requesting Intent used IMG_REQUEST
 
Tim Moores
Saloon Keeper
Posts: 5564
143
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Olajire Abdullahi wrote:It is not wrong and the App works fine without crash or Error


Don't be too sure of the former - see Norm's post.

The latter is obviously wrong - the reason you posted in the first place is because the code is not actually "working fine", yes?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!