posted 2 years ago
In my problem, I have my MainActivity, with a TextView and EditText, and a Thread, excecuting a method, which should send out messages to the TextView and receive the content of an EditText. The problem is receiving text from the EditText, since it throws the exception:
android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
I have looked at the possibilities of runAsUiThread() and Handler, but i haven't found a solution to pass the content of the EditText yet.
Have I overseen a possibility with the Handler to pass content back, or is there some other solution here?
I'll try to post my cropped code so you will gain some knowledge about what I am trying to achieve.
Any help is greatly appreciated.
android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
I have looked at the possibilities of runAsUiThread() and Handler, but i haven't found a solution to pass the content of the EditText yet.
Have I overseen a possibility with the Handler to pass content back, or is there some other solution here?
I'll try to post my cropped code so you will gain some knowledge about what I am trying to achieve.
Any help is greatly appreciated.
posted 2 years ago
-
1
-
-
-
-
Welcome to the Ranch
You have arrived in the wrong place; this forum is for discussing the website itself. I shall try moving you to the Android forum and see whether people there can help.

You have arrived in the wrong place; this forum is for discussing the website itself. I shall try moving you to the Android forum and see whether people there can help.
