BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-19-2007, 04:29 AM   #1
Cycom
New Member
 
Join Date: May 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 6
Default Private variables assignment

Please Login to Remove!

Hi.

I have a very strange behavior of my application at 8800 blackberry device.

For some strange reason I could not assign a value to private int class members. At device simulator it works OK.

Can someone take a look and help me?

Thank you,
Rainman

Here is a simplified code:

PenDemo.java
class PenDemo extends UiApplication
{
private PenDemoScreen _screen;

// constructors and so on
//.....

// inner class
private class InputThread extends Thread
{
public void run()
{
//..........
XYPoint[] buffer;
// ......

for (;;)
{
penPoint = new XYPoint(buffer[2], buffer[3]);
xyPoint = new XYPoint();

// in TransformToXY I'm using classes from
// other project in my JDE, but I deploy it into
// devise
TransformToXY(penPoint, xyPoint);

// addPoint will lead to problem
// statement
_screen.addPoint(xyPoint.x, xyPoint.y);
_screen.invalidate(xyPoint.x, xyPoint.y, 1, 1);
}
}
//...
}
}


PenDemoScreen.java

class PenDemoScreen extends MainScreen
{
private DrawArea _drawArea;
//.....

public void addPoint(int x, int y)
{
_drawArea.addPoint(x, y);
}
// .........
}

DrawArea.java
class DrawArea extends BitmapField
{
private int _newX;
private int _newY;
private boolean _pointAdded;

public void addPoint(int x, int y)
{
// here is a problem.
// when I trace this code in simylator, I could see
// correct assignment and _newX and _newY obtains
// there new values.
// at device _newX and _newY has some values and they
// could not been changed they are the same during app
// execution and when I run app next time they could
// have another values.
// The very strange thing that _pointAdded could be
// changed.
this._newX = x;
this._newY = y;
this._pointAdded = true;

}

public void paint(Graphics graphics)
{
graphics.drawLine(10, 10, 234, 568);

if(this._pointAdded)
{
graphics.setColor(Graphics.BLACK);
graphics.drawPoint(this._newX, this._newY);
this._pointAdded = false;
}
}
}
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1pcs  Dahua 16 Road Network DVR Motherboard 40_071 80146782 N1414 picture

1pcs Dahua 16 Road Network DVR Motherboard 40_071 80146782 N1414

$99.00



Used & Tested ADVANTECH AIMB-742 REV A1 AIMB-742VE Motherboard picture

Used & Tested ADVANTECH AIMB-742 REV A1 AIMB-742VE Motherboard

$281.13



Used & Tested IEI Rocky-4784EV V1.2 Industrial Motherboard picture

Used & Tested IEI Rocky-4784EV V1.2 Industrial Motherboard

$302.20



Used & Tested IEI IMBA-8650GR-R22-NOCB-BULK IMBA-8650GR Motherboard picture

Used & Tested IEI IMBA-8650GR-R22-NOCB-BULK IMBA-8650GR Motherboard

$380.88



New ADVANTECH PCA-6751 Motherboard picture

New ADVANTECH PCA-6751 Motherboard

$247.63



MAGNETIC AUTOCONTROL   BARRIER GATE MOTHERBOARD  1013.5036 / 10135036 picture

MAGNETIC AUTOCONTROL BARRIER GATE MOTHERBOARD 1013.5036 / 10135036

$325.95







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.