Make Context.getClassLoader() work.
Context.getClassLoader() is used by the LayoutInflater and can be used by custom views. However, when called from the LayoutInflater, this needs to return only the Framework classes. This is so that the IDE gets a chance to instantiate the custom views, which helps in better error reporting and better fallback in case of exceptions, like MockView. To workaround this need of the same method returning different results based on where it's called from, the method call in LayoutInflater is renamed to getFrameworkClassLoader() and the new method is injected in Context. The implementation of getFrameworkClassLoader() maintains the existing behaviour of getClassLoader(). Context.getClassLoader() is now modified to return classes from both Framework and the app namespace. Also, update the list of packages to search for Framework views. Change-Id: I1a6be4aa1fc5c1c5520b5440a348a52f10b6eb3b
Loading
Please register or sign in to comment