• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Saloon Keeper
Posts: 7594
177
  • 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: 5008
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
Saloon Keeper
Posts: 7594
177
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic