|
-
March 18th, 2011, 03:10 AM
#3
Re: forcefully stop a thread
Thanks for the reply..
To give a brief summary about my task before answering the questions..
I am working on blackberry application development and my application calls the in built blackberry Map to show the particular location i want to display (Which i have succeeded) but the location keeps changing and I want to update the same on the map.. For this I dont want the user to forcefully close the application to show the update..
To answer ur questions..
1. I can close the application manually but I dont want that to be done.
2. Yes.. The thread calls an external application.
3. Yes.. I am able to add the code and call the application.
4. The application is called by blackberry api Invoke.
Some code snippet for your reference
public class UpateThread extends Thread{
BM_SingleLoc singleLocScreen;
public UpateThread(BM_SingleLoc singleLocScreen){
this.singleLocScreen = singleLocScreen;
}
public void run(){
//for(; {
try{
Thread.sleep(10000);
}catch(InterruptedException e){
// Catch the exception here
}
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
// TODO Auto-generated method stub
singleLocScreen.callMap();
}
});
//}
}
}
---------------------
public final class BM_SingleLoc extends MainScreen
{
public BM_SingleLoc()
{
UpateThread thread = new UpateThread(this);
thread.start();
}
public void callMap(){
String document = "<lbs clear='ALL'><location lon='-7938675' lat='4367022' label='Toronto, ON' description='Go Leafs Go!' zoom='10'/></lbs>";
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments( MapsArguments.ARG_LOCATION_DOCUMENT, document));
}
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|