Perhaps the 'num' in the nested class is being confused with 'num' in mHandler. 'num' in your nested class (class A) is not defined. Try changing it to int num = 4;