我initLoader()
在使用 Loader 时遇到问题。它不采用第三个参数为空。任何人都可以帮我解决错误吗?
错误消息::
initLoader(int, Bundle, LoaderManager.LoaderCallbacks<D>)
LoaderManager 类型中的方法不适用于参数(int、null、TestActivity)
这是我的代码。
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import utilcontentprovider.F1DatabaseMetaData.TeacherTableMetaData;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.support.v4.app.LoaderManager;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.widget.CursorAdapter;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
public class TestActivity extends SherlockActivity
implements LoaderCallbacks<Cursor>{
ListView listView;
ArrayList<String> listName = new ArrayList<String>();
ArrayList<String> listId = new ArrayList<String>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
listView = (ListView) findViewById(R.id.list);
getLoaderManager().initLoader(0, null, this);
}
}