{"action":"opened","issue":{"url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/242","labels_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/242/comments","events_url":"https://api.github.com/repos/chrisjenx/Calligraphy/issues/242/events","html_url":"https://github.com/chrisjenx/Calligraphy/issues/242","id":128629732,"number":242,"title":"Crash in `CalligraphyLayoutInflater` when inflating custom view in Android 4.1","user":{"login":"ygnessin","id":1173700,"avatar_url":"https://avatars.githubusercontent.com/u/1173700?v=3","gravatar_id":"","url":"https://api.github.com/users/ygnessin","html_url":"https://github.com/ygnessin","followers_url":"https://api.github.com/users/ygnessin/followers","following_url":"https://api.github.com/users/ygnessin/following{/other_user}","gists_url":"https://api.github.com/users/ygnessin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygnessin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygnessin/subscriptions","organizations_url":"https://api.github.com/users/ygnessin/orgs","repos_url":"https://api.github.com/users/ygnessin/repos","events_url":"https://api.github.com/users/ygnessin/events{/privacy}","received_events_url":"https://api.github.com/users/ygnessin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-25T20:23:38Z","updated_at":"2016-01-25T20:23:38Z","closed_at":null,"body":"Below is a `ClassCastException` stack trace coming from an `EditText` being inflated with `CalligraphyLayoutInflater` while inflating a custom view that I've built called `LocationEntryView`. I've been seeing this crash in the wild in my production app. I have not seen the crash locally so unfortunately I do not know how to reproduce. However Crashlytics does tell me that this only affects Android 4.1 users (and maybe earlier - 4.1 is lowest version my app supports).\r\n\r\nI suppose it's possible that this crash is not a Calligraphy issue, but because it involves text views, strings, and `Editable`s and occurs during inflation, this is currently my best guess. Furthermore, I wasn't seeing this crash until I added Calligraphy to my app.\r\n\r\nMy Calligraphy version is `2.1.1-SNAPSHOT`\r\n\r\nThank you for helping me look into this. And thanks for all the work you put into making this fantastic library.\r\n\r\n```\r\nCaused by java.lang.ClassCastException: java.lang.String cannot be cast to android.text.Editable\r\n       at android.widget.EditText.getText(EditText.java:75)\r\n       at android.widget.EditText.getText(EditText.java:50)\r\n       at android.widget.TextView.setTextIsSelectable(TextView.java:4673)\r\n       at android.widget.TextView.(TextView.java)\r\n       at android.widget.EditText.(EditText.java)\r\n       at android.widget.EditText.(EditText.java)\r\n       at java.lang.reflect.Constructor.constructNative(Constructor.java)\r\n       at java.lang.reflect.Constructor.newInstance(Constructor.java:417)\r\n       at android.view.LayoutInflater.createView(LayoutInflater.java:587)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.onCreateView(CalligraphyLayoutInflater.java:164)\r\n       at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.onCreateView(CalligraphyLayoutInflater.java:148)\r\n       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)\r\n       at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)\r\n       at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)\r\n       at android.view.LayoutInflater.inflate(LayoutInflater.java:459)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)\r\n       at android.view.LayoutInflater.inflate(LayoutInflater.java:396)\r\n       at android.view.LayoutInflater.inflate(LayoutInflater.java:352)\r\n       at android.view.View.inflate(View.java:16237)\r\n       at com.myapp.myapp.views.widgets.LocationEntryView.init(LocationEntryView.java:75)\r\n       at com.myapp.myapp.views.widgets.LocationEntryView.(LocationEntryView.java)\r\n       at java.lang.reflect.Constructor.constructNative(Constructor.java)\r\n       at java.lang.reflect.Constructor.newInstance(Constructor.java:417)\r\n       at android.view.LayoutInflater.createView(LayoutInflater.java:587)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)\r\n       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)\r\n       at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)\r\n       at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)\r\n       at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)\r\n       at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)\r\n       at android.view.LayoutInflater.inflate(LayoutInflater.java:489)\r\n       at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)\r\n       at android.view.LayoutInflater.inflate(LayoutInflater.java:396)\r\n       at com.myapp.myapp.fragments.WelcomeFragment.onCreateView(WelcomeFragment.java:50)\r\n       at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:831)\r\n       at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1037)\r\n       at android.app.BackStackRecord.run(BackStackRecord.java:635)\r\n       at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1399)\r\n       at android.app.Activity.performStart(Activity.java:5075)\r\n       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2328)\r\n       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2391)\r\n       at android.app.ActivityThread.access$600(ActivityThread.java:151)\r\n       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335)\r\n       at android.os.Handler.dispatchMessage(Handler.java:99)\r\n       at android.os.Looper.loop(Looper.java:155)\r\n       at android.app.ActivityThread.main(ActivityThread.java:5520)\r\n       at java.lang.reflect.Method.invokeNative(Method.java)\r\n       at java.lang.reflect.Method.invoke(Method.java:511)\r\n       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)\r\n       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)\r\n       at dalvik.system.NativeStart.main(NativeStart.java)\r\n```"}}