Recompiling Android Launcher2 (Gingerbread)
I'm attempting to recompile the Launcher2 (Gingerbread) application, so that i can modify it.
However, I get a fair few errors (120ish), namely:
mLeft, mTop, mBottom, mRight, mParent, mContext cannot be resolved to a variable.
These come from (wha开发者_Go百科t I can see anyway), private members of the "TextView" widget.
Is there any way to access these private members, or would I need to do some other magic to get this working?
Cheers!
These refer to private/protected members of the View
and related classes. Lots of them have getters/setters, for instance all of the above (if they are just getting the value) could be replaced with the
getLeft()
, getTop()
, getBottom()
, getRight()
and getContext()
methods of the View class.
Some of them though, may not have public ways to access them. In that case you can either:
- Copy the relevant classes into your project and change the visibility of the members
- Use reflection (ugly, may break) to modify private fields of other classes.
You cannot compile Launcher2 except as part of a full firmware build, most likely.
精彩评论