0

ListViewを返すビューとクラスを備えた単純なアプリケーションがあります。アプリケーションは、リファクタリングしない限り機能します。クラス名の名前を変更するだけでなく、リファクタリングします。すべてが適切に変更されているように見えますが、アプリケーションは次の例外をスローします:android.view.InflateException:バイナリXMLファイルの行#2:クラスの拡張エラー

元の名前にリファクタリングすると、すべて問題ありません。私が行方不明になっている名前が変更されていないものは何ですか?

コードは

package com.mynamespace.more.views;

import com.mynamespace.more.QTEvent;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.CheckedTextView;
import android.widget.LinearLayout;

public class MyListItem extends LinearLayout {

    private QTEvent qtEvent;
    private CheckedTextView checkbox;

    public MyListItem(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        checkbox = (CheckedTextView)findViewById(android.R.id.text1);
    }

    public void setQTEvent(QTEvent q) {
        this.qtEvent = q;
        checkbox.setText(q.getName());
        checkbox.setChecked(q.isComplete());
    }

    public QTEvent getEvent() {
        return qtEvent;
    }

}
4

1 に答える 1

0

It would appear that some layout XML is still referencing the old name. The error will tell you which file and line this is occurring on.

You might also need to do an Eclipse Project -> Force Clean, or ant clean from the command line, to get rid of earlier editions of pre-compiled classes and whatnot.

于 2010-04-23T11:24:37.290 に答える