When I am try to run a thread then it is giving following error
startApp threw an Exception
java.lang.NullPointerException
java.lang.NullPointerException
at threadlearn.Midlet.startApp(Midlet.java:28)
MIDlet.java
public class Midlet extends MIDlet {
ThreadClass th;
public void startApp() {
th.startThread();
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
class ThreadClass implements Runnable{
Thread t;
ThreadClass() {
t = new Thread(this);
}
public void startThread() {
t.start();
}
public void run() {
System.out.println("We are in Thread");
}
}