android UI react weird in gyroscope event -


i have app used gyroscope control value of padding. doesn't update ui unless i'm touching or moving device screen.

private void gyrofunction(sensorevent event) {     sensormanager             .getrotationmatrixfromvector(mrotationmatrix, event.values);     sensormanager.remapcoordinatesystem(mrotationmatrix,             sensormanager.axis_x, sensormanager.axis_z, mrotationmatrix);     sensormanager.getorientation(mrotationmatrix, orientationvals);      // must put line of code make ui thread update every time      temptxtview.settext(string.valueof(orientationvals[2]));      imgv.setpadding((int) math.round(orientationvals[0]),             (int) math.round(orientationvals[1]),             (int) math.round(orientationvals[0]),             (int) math.round(orientationvals[1])); } 

however when added temporary textview update value according gyro event, works. don't think it's solution block screen. there other solution?

does calling imgv.invalidate() after setting padding work?


Comments

Popular posts from this blog

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -