假设有一个service类是 AbcSvr在其内有一个static方法供外调用启动自己。
public static void startAbcSvr(Context ctx ) {
ctx.startService(new Intent(ctx, AbcSvr.class));
}
在某种情况下回抛出Exception
Exception Ljava/lang/RuntimeException; thrown while initializing Lcom/XXXX/AbcSvr;
应是Dalvik的一个bug。解决的办法是将startAbcSvr方法移动到其他类去即可。