Reputation: 3413
I have a question about threading in android
If call a method which is in my activity from a run() method of a new thread is that method executed in that new thread or in main thread. for example.
...
public void run()
{
someMethod(); //some method declared in activity
}
...
Upvotes: 1
Views: 244
Reputation: 213243
Since each Thread has its own stack, and given that Threads
don't share stack. So, once a thread is started, then any method invoked from it will be executed in that Thread
only.
Upvotes: 3
Reputation: 2097
When thread is create it has it's own stack. So whatever methods you call from that thread is execute in that thread's stack only.
Upvotes: 0