Android应用在使用内容提供商时崩溃了应用。即光标类
package com.example.avinash.contentprovider;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Uri myuri= ContactsContract.Contacts.CONTENT_URI;
String[] proj=new String[]{
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY,
ContactsContract.Contacts.CONTENT_ITEM_TYPE,
ContactsContract.Contacts.DISPLAY_NAME};
Cursor c=getContentResolver().query(myuri,proj,null,null,null);
}
}