After much debugging it turns out that this is not possible to be done in this way.
TextView class constructor will call Resources.loadDrawable(TypedValue value, int id)
which is private. loadDrawable
only calls Resources.getCachedDrawable(LongSparseArray<WeakReference<ConstantState>> drawableCache, long key)
, which is again private.
How do Google's programmers achieve this kind of show-stoppers is beyond my comprehension. It takes extremely meticulous planning to give a programmer hope and then squash them later on with a well-aimed private, static or whatever. /rant