【发布时间】:2011-01-25 22:00:47
【问题描述】:
我有一个代码在 99% 的时间都可以运行,因为它部署在许多客户端中,但有时我会得到以下结果:
java.lang.reflect.InvocationTargetException android.widget.LinearLayout.(LinearLayout.java:92) java.lang.reflect.Constructor.constructNative(Native Method) java.lang.reflect.Constructor.newInstance(Constructor.java:446) android.view.LayoutInflater.createView(LayoutInflater.java:499) com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562) android.view.LayoutInflater.rInflate(LayoutInflater.java:617) android.view.LayoutInflater.inflate(LayoutInflater.java:407) android.view.LayoutInflater.inflate(LayoutInflater.java:320) com.mycode.mycode.MyClass.draw(xxxxxxx) .....
在我的代码上我有:
LayoutInflater li = (LayoutInflater) 这个 .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
theview = li.inflate(R.layout.partofthescreen, 某个容器,假);
所以问题是我为什么会收到 InvocationTargetException。
谢谢
【问题讨论】: