开发者

Recompiling Android Launcher2 (Gingerbread)

开发者 https://www.devze.com 2023-03-03 18:36 出处:网络
I\'m attempting to recompile the Launcher2 (Gingerbread) application, so that i can modify it. However, I get a fair few errors (120ish), namely:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消