So what's happening here: when I get that class, to change an image view from the second class Using the runOnUiThread () method, I am calling a message from another phone using it mainclass.runOnUiThread (new Runnable ...) and so on. This works for the first time, but when I press the back button to exit the application, and then re-launch the application, the image view is no longer updated. The log I took was, I find that everything is fine and is going on, but there is no change in image view. I have not found any errors and when I run the application, it does not crash, it does not just update the image view.
Edit *: So this is what I am actually using to replace the image in a class that does not extend the activity
PeerActivity RunOnUiThread {New Overtime} {@ Override Public Wide Run) {Log. V ("Thread @", "Thread is On"); Logs. V ("Thread @ 2", Decoded Image .Ststring ()); // Tudo auto-generated method stub peer activity. IvPhoto.setImageBitmap (decoded image); Logs. V ("Thread @ 3", "Last UI Change");}}); Where peerActivity holds the context of another class and has ivPHoto image view. What do I think is that I need to do this when the program stops (when I go to program manager, it is still a Force Close button available) that searches for a way to kill that thread. Is there any way to do this?
Edit2 *: That's why I put a bunch of different methods to work on the UI thread and all of these give me the same result: This program works perfectly for the first time but when I use the previous button I suppress and close it and open it again, the image view is no longer updated. If I close the app then it works properly until I close it and I open it again.
Try using instead.
Comments
Post a Comment