fix mainactivity's bug in sample