Re: forcefully stop a thread
Can you clarify some points:
1. Are you saying you can't close the application called by the thread?
2. Is the application called by the thread an external executable?
3. Can you add code to the thread that calls the application?
4. How is the application called by the thread?
Precise language is not the problem. Clear language is the problem...
R. Feynman
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));
}
}
Re: forcefully stop a thread
When posting code use the CODE tags so it stays readable (see my sig).
If it's just a question of stopping a thread, why don't you run a timer whose task interrupts the thread?
I'm not really sure what the problem is here...
The outcome of any serious research can only be to make two questions grow where only one grew before...
T. Veblen