문제 설명
Android ImageView가 업데이트되지 않습니다. (Android ImageView is not being updated)
I pass the bitmap to android ndk, keep the pixels in my class and according to the user touch I change the pixels with corresponding (jni)c++ calls. But imageview is not being updated. When I write bitmap in file I see that bitmap is changed. Also, when I click on Home button and return back to app, I see the changes. What can be the reason of such strange behavior? Aslo, this problem exists on Samsung Galaxy Note 10.1(Android 4.0.3) but in galaxy Tab 7.0 works fine.
What I have tried so far:
- I have tried to invalidate the Imageview ‑ doesn't work.
- Copy the bitmap and reset Imageview's bitmap ‑ works.
- Call c++ methods in separate thread ‑ doesn't work.
참조 솔루션
방법 1:
When you write bitmap file, is it operated in C++ part? If so, java and NDK is not perfectly synchronized. Then, it may helps you. https://stackoverflow.com/a/10384585/1811103
(by someUser、Sohyun Ahn)