No bug: Add logic

if (activity != null && activity.isFinishing() == true) {
				break;
			}

to make sure the ping thread will stop when the application quit.