• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Uploading an image in WebView

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4936
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic