私は Java の専門家ではありませんが、Java を使用しているときに発生するエラーは通常、理解できます。しかし、この特定のものには頭を悩ませています。
私は次のクラスを持っています(この投稿を読みやすくするために不要な毛羽立ちを取り除きました)
package miui.content.res;
import android.app.ActivityManagerNative;
import android.app.IActivityManager;
import android.content.res.Configuration;
import android.os.Parcel;
import android.os.RemoteException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
public class ExtraConfiguration
implements Comparable<ExtraConfiguration>
{
public int themeChanged;
public int compareTo(ExtraConfiguration that)
{
return this.themeChanged - that.themeChanged;
}
}
私には、これはかなり簡単に思えますが、コンパイル時に次のエラーが発生します。
out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/miui/content/res/ExtraConfiguration.java:2:
name clash:
compareTo(java.lang.Object) in miui.content.res.ExtraConfiguration and
compareTo(T) in java.lang.Comparable<miui.content.res.ExtraConfiguration>
have the same erasure, yet neither overrides the other
消去の概念をブラッシュアップしました。コード スニペットに示す compareTo() メソッドは、ExtraConfiguration クラスで唯一のものです。この時点で、何が問題なのかわかりません。
この特定のクラスは、逆コンパイルされたソースから複製しようとしている MIUI として知られる ROM の Android フレームワークからのものです。それまでの間、私は単純に「implements Comparable」を削除しました
前もって感謝します。