Monthly Archives: October 2016

onRequestPermissionsResult not called on Fragments in Android

By | October 12, 2016

This is a common mistake that people make when coding for marshmallow. When in AppCompatActivity, you should use ActivityCompat.requestPermissions; When in android.support.v4.app.Fragment, you should use simply requestPermissions (this is an instance method of android.support.v4.app.Fragment) If you call ActivityCompat.requestPermissions in a fragment, the onRequestPermissionsResult callback is called on the activity and not the fragment. If you… Read More »

Error Handling in Swift

By | October 1, 2016

When calling a method that may cause a failure, you normally pass it with an NSError object (as a pointer). If there is an error, the object will be set with the corresponding error. You then check if the error object is nil or not and respond to the error accordingly. That’s how you handle… Read More »