The questions refers specifically to spawning threads through anonymous inner classes, and not at a class level extending Thread / implementing Runnable. If they are the same please explain why.
Can anyone explain what the difference is between these 2 ways of spawning a new background Thread in Android:
1. With new Runnnable
Thread backgroundThread1 = new Thread(new Runnable() {
@Override
public void run() {
// Do stuff in background
}
});
backgroundThread1.start();
2. Without new Runnnable
Thread backgroundThread2 = new Thread() {
@Override
public void run() {
// Do stuff in background
}
};
backgroundThread2.start();