Helo. i need help about this code. i'll be be made.It doesn't work. i couldn't find the problem. In this code:i create a canvas class.i show the object of canvas on screen. Then the location informations(GPS) uptade via upDate class,but the informations about gps location doesn't show on canvas object.


public class canvasMidlet extends MIDlet implements LocationListener {

private Display display;
private Form form;
private Command cmdExit,cmdOK;
private StringItem si;
showInfo can;

Location loc;
LocationProvider provider;
Coordinates coor;
Criteria cr;

public canvasMidlet()
{
display = Display.getDisplay(this);
}

public class showInfo extends Canvas implements CommandListener
{
String messageinfo="";

public showInfo()
{
cmdExit = new Command("Exit",Command.EXIT,5);
cmdOK = new Command("OK",Command.OK,1);
addCommand(cmdOK);
addCommand(cmdExit);
setCommandListener(this);
setTitle("GPS Information");

}

public void setMessage(String s)
{
messageinfo=s;
}
public void paint(Graphics g)
{
g.setColor(255);
g.fillRect(0,0,getWidth(),getHeight());
g.setColor(255,255,255);
g.drawString(messageinfo,5,5,0);

}

public void commandAction(Command c, Displayable d)
{
if (c == cmdOK){
Connection();

} else if (c == cmdExit) {
//destroyApp(false);
notifyDestroyed();
}
}
}

public void Connection ()
{
try
{
cr=new Criteria();
cr.setHorizontalAccuracy(25);
cr.setSpeedAndCourseRequired(true);
cr.setAltitudeRequired(true);
cr.setPreferredResponseTime(5000);
provider=LocationProvider.getInstance(cr);
if(provider!=null)
//finf.append("\n\nBağlantı sağlandı.......");
provider.setLocationListener(this,5,10,10);

}
catch(LocationException ex)
{
Alert a=new Alert("ERROR :");
a.setString(ex.toString());a.setTimeout(Alert.FOREVER);
a.setTimeout(Alert.FOREVER);

}


}






public void startApp() {
can=new showInfo();
display.setCurrent(can);
}




public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

public void locationUpdated(LocationProvider provider, Location location)
{
upDate t=new upDate(can);
t.start();

}

public void providerStateChanged(LocationProvider provider, int newState) {
}


/////////////////////////
//THREADDDDDDDDDDDDDD
public class upDate extends Thread
{
showInfo canvas;
public upDate(showInfo c)
{
canvas=c;

}

public void run()
{

try
{
// loc=provider.getLocation(-1);
if(loc.isValid())
{
// finf.deleteAll();
// String s="";

coor=loc.getQualifiedCoordinates();
double en=coor.getLatitude();
double boy=coor.getLongitude();
float yon=loc.getCourse();
double hiz=loc.getSpeed();
long time=loc.getTimestamp();
String enlem,boylam;
enlem=coor.convert(coor.getLatitude(),1);
boylam=coor.convert(coor.getLongitude(),1);

String s="";

s="Enlem : "+enlem+"\nBoylam : "+boylam+
"\nYön : "+yon+"\nHız : "+hiz+"\nZaman : "+time;
canvas.setMessage(s);
canvas.repaint();

}
}
catch(Exception ex)
{
}

}
}




}