【发布时间】:2015-03-27 10:54:16
【问题描述】:
我有一些用 Java 编写的代码,我想将其转换为 Xamarin (C#)。我如何用 C# 编写这个?
private static final Class<?>[] mSetForegroundSignature = new Class[] { boolean.class };
private static final Class<?>[] mStartForegroundSignature = new Class[] { int.class, Notification.class };
private static final Class<?>[] mStopForegroundSignature = new Class[] { boolean.class };
我不知道如何获得这个“boolean.class”和“>”也不起作用。 因为这样就会被调用
Method mStartForeground = getClass().getMethod("startForeground", mStartForegroundSignature);
然后为每个喜欢的一些包装器
if (mStartForeground != null) {
mStartForegroundArgs[0] = Integer.valueOf(id);
mStartForegroundArgs[1] = notification;
invokeMethod(mStartForeground, mStartForegroundArgs);
return;
}
【问题讨论】: