我在碎片网络中使用加载器。我已经实现LoaderManager.LoaderCallbacks<Cursor>
但我仍然收到错误“initLoader(int,Bundle,LoaderManager.LoaderCallbacks<D>)
类型LoaderManager
中的方法不适用于参数(int, null, Details)
”
package com.example.ms;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.app.LoaderManager;
import android.content.Loader;
import android.database.Cursor;
import android.support.v4.content.CursorLoader;
import android.support.v4.widget.CursorAdapter;
public class Details extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> {
private static final int LIST_ID =0;
String University_name;
Long id;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v= inflater.inflate(R.layout.details, container, false);
TextView Name=(TextView)v.findViewById(R.id.university_name);
Name.setText(University_name);
}
public void onCreate(Bundle savedInstanceState)
{ TaskList tl=(TaskList)getActivity();
Bundle bundle=tl.sendData();
University_name=bundle.getString("UniName");
id=bundle.getLong("id");
getLoaderManager().initLoader(LIST_ID, null,this);
}
@Override
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onLoadFinished(Loader<Cursor> arg0, Cursor arg1) {
// TODO Auto-generated method stub
}
@Override
public void onLoaderReset(Loader<Cursor> arg0) {
// TODO Auto-generated method stub
}
我的代码不完整,我还没有实现加载器方法