Implement isValidFragment to fix Android bug

This bug fixed in Android API 19 (Kitkat).
More info:
http://securityintelligence.com/new-vulnerability-android-framework-fragment-injection#.VGkN4lWUd1Y