K
K
Konstantin2012-05-29 09:52:40
Android
Konstantin, 2012-05-29 09:52:40

Doing a long running operation in a button handler in Android?

Hello!
I have a button which, when clicked, should perform a long running operation and the new received data is displayed and updated in a TextField. However, in practice, the application freezes. I tried to do Thread.sleep(1000), but the essence of this does not change.
Please advise what needs to be done to solve this problem.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SabMakc, 2012-05-29
@SabMakc

Have you tried moving a long-running operation to a separate thread?

S
silentnuke, 2012-05-29
@silentnuke

all long-running operations must be moved to a separate thread ala thread/asyncktask/service, etc., otherwise the application will stop responding to receive messages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question