Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/47682559
Not much to say, no nonsense, directly on the code, we see all understand
/** * ContentProvider Action XML File Encapsulation Example method * @author liuyazhuang*/public Cursor query (Uri uri, string[] projection, String Select Ion, string[] Selectionargs, String sortOrder) {sharedpreferences sp= getcontext (). Getsharedpreferences ("pim_ Preferences ", context.mode_private); string[] columns = new string[] {"_id", "url", "Target"}; Matrixcursor stringcursor = new matrixcursor (columns); String row[] = new String[3];row[0] = "1"; row[1] = sp.getstring ("url", ""); row[2] = sp.getstring ("Target", ""); Stringcurso R.addrow (row); return stringcursor;}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android--contentprovider Operation XML