fixed issue #1945, canWrite is not supported in Android API 8, using reflection now