Android Studio 2.1.2
私はこの警告を受けており、なぜそれが見つからないのでしょうか。私は生の種類を使用していません。生のタイプのメンバへの未確認コール
Unchecked call to attachView(DownloadViewContract) as a member of raw type
私はこれは私の見解ためのインタフェース
public interface DownloadViewContract {
void onSuccessDownload();
void onFailureDownload(String errMsg);
}
そして、私のフラグメントである次のインターフェイスに
public interface DownloadPresenterContract {
interface Operations<DownloadViewContract> {
void attachView(DownloadViewContract view);
void detachView();
void getData();
}
}
そして、次の実装
public class DownloadPresenterImp implements
DownloadPresenterContract.Operations<DownloadViewContract> {
private DownloadViewContract mView;
private DownloadPresenterImp() {
}
public static DownloadPresenterImp getNewInstance() {
return new DownloadPresenterImp();
}
/* Operations */
@Override
public void attachView(DownloadViewContract view) {
mView = view;
}
}
を持っています私の意見
public class DownloadView extends Fragment implements DownloadViewContract {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
mDownloadPresenterContract = DownloadPresenterImp.getNewInstance();
/* UNCHECKED MEMBER TO RAW TYPE */
mDownloadPresenterContract.attachView(DownloadView.this);
}
.....
}
私は明示的に私のプレゼンターインターフェイスタイプとしてDownloadViewContract
を命名していますように私は警告を取得していますなぜ私は理解していません。私の見解ではDownloadViewContract
インターフェイスを実装しているので、何か問題があるとは思わない。
任意の提案のための多くのおかげで、
あなたは 'mDownloadPresenterContract'の宣言を表示することができますか? – manouti
DownloadPresenterContractは既に私の質問にあります。パブリックインターフェイスDownloadPresenterContract { インターフェイス操作 { void attachView(DownloadViewContract view); void detachView(); void getData(); } } –
ant2009