Quote:
Originally Posted by Dougsg38p
You do not want to be converting images in the drawListRow method.
Have you tried single stepping the code in the debugger? Also try some strategic System.out statements? If the Bitmap was created correctly, then it is either a) not being stored correctly as you think, or b) somehow it is getting clobbered.
|
Debgged my last 24 hours away! I know whereever i do my defensice programming i get a null pointer exception
public Product(String productId, String productName, String productPrice, String productOffer, String productOfferValidity, String productImagePath, String productRating, String productQuantity)
{
this.productImagePath = productImagePath;
if(this.productImagePath != null)
{
try
{
image = new WebBitmapField(productImagePath + ";" + "deviceside=true;apn=wap.o2.co.uk;tunnelauthuserna me=o2wap;tunnelauthpassword=password");
this.productImage = image.getBitmap();
everytime i construct a product it passes this code and there aare enough outputs in event log to tell me that the image is being received so the string variables are accessible, the event log tells me the image is being retrieved(and i know the class converter works), i just get a nullpointerexception at drawbitmap if i don't check for null before. if i check for null before i don't get to drawbitmap. the class/s i use for the conversiion is on this page
Blackberry WebBitmapField | Coderholic
The only thing i can think of is something on that page in a post thats says put the getBitmap in a while loop until it returns true but don't know if that's a good idea or what the person means properly anyway.
This sounds complicated maybe but the basics of it are mystifying becaus it's already doing it with another variable of the object i'm accessing, just not wiht the image of the product.
Anyone help me please?