If you pass a numeric value as the text to a text field, Android will try to interpret it as a resource Id. Make it a text first. The preferred way is to do:
num.setText(String.valueOf(returnnum));
(For good practices on conversion to string, check this post)