Activity managedQuery - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Activity managedQuery method.

This code example shows how to use the following methods:managedQuery
    String[] PROJECTION=new String[] {  Contacts.Phones._ID,
                                        Contacts.Phones.NAME,
                                        Contacts.Phones.NUMBER
                                      }; 
    String[] ARGS={String.valueOf(Contacts.Phones.TYPE_MOBILE)};
    Cursor c=a.managedQuery(Contacts.Phones.CONTENT_URI,
                            PROJECTION,
                            Contacts.Phones.TYPE+"=?", ARGS,
                            Contacts.Phones.NAME);
     
    SimpleCursorAdapter adapter=new SimpleCursorAdapter(a,
                                    android.R.layout.simple_spinner_item,
                                    c,
                                    new String[] {
                                      Contacts.Phones.NAME
                                    }, 
                                    new int[] { 
                                      android.R.id.text1
                                    }); 
                                     
7
CodeRank
This code example shows how to use the following methods:managedQuery
class NewContactsAdapterBridge extends ContactsAdapterBridge { 
  ListAdapter buildNameAdapter(Activity a) {
    String[] PROJECTION=new String[] {  Contacts._ID,
                                        Contacts.DISPLAY_NAME,
                                      }; 
    Cursor c=a.managedQuery(Contacts.CONTENT_URI,
                            PROJECTION, null, null, null);
     
    return(new SimpleCursorAdapter( a,
                                    android.R.layout.simple_list_item_1,
                                    c,
                                    new String[] {
                                      Contacts.DISPLAY_NAME
                                    }, 
                                    new int[] { 
                                      android.R.id.text1
                                    })); 
  } 
   
  ListAdapter buildPhonesAdapter(Activity a) {
7
CodeRank
This code example shows how to use the following methods:managedQuery
class OldContactsAdapterBridge extends ContactsAdapterBridge { 
  ListAdapter buildNameAdapter(Activity a) {
    String[] PROJECTION=new String[] {  Contacts.People._ID,
                                        Contacts.PeopleColumns.NAME
                                      }; 
    Cursor c=a.managedQuery(Contacts.People.CONTENT_URI,
                            PROJECTION, null, null,
                            Contacts.People.DEFAULT_SORT_ORDER);
     
    return(new SimpleCursorAdapter( a,
                                    android.R.layout.simple_list_item_1,
                                    c,
                                    new String[] {
                                      Contacts.PeopleColumns.NAME
                                    }, 
                                    new int[] { 
                                      android.R.id.text1
                                    })); 
  } 
   
7
CodeRank
This code example shows how to use the following methods:managedQuery, startManagingCursor
	@SuppressWarnings("unused") 
	private static final String TAG = "MediaUtils";
	 
	public static String getPath(Activity activity, Uri uri) {
	    String[] projection = { MediaStore.Images.Media.DATA };
	    Cursor cursor = activity.managedQuery(uri, projection, null, null, null);
	    activity.startManagingCursor(cursor);
	    int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
	    cursor.moveToFirst();
	    return cursor.getString(column_index);
	} 
	 
	public static int getExifOrientation(String filepath) {
		int degree = 0;
		ExifInterface exif = null;
		try { 
			exif = new ExifInterface(filepath);
		} catch (IOException ex) {
			ex.printStackTrace();
		} 
7
CodeRank
This code example shows how to use the following methods:managedQuery
        startActivity(intent);
    } 
 
    private void installListAdapter(Activity activity) {
        setListAdapter(
            new ContactsCursorAdapter( 
                activity,
                activity.managedQuery(
                    Contacts.CONTENT_URI,
                    CONTACTS_PROJECTION,
                    CONTACTS_FILTER,
                    null, 
                    CONTACTS_SORT)));
    } 
} 
7
CodeRank
This code example shows how to use the following methods:managedQuery
    String[] PROJECTION=new String[] { Contacts._ID,
                                              Contacts.DISPLAY_NAME,
                                              Phone.NUMBER
                                            }; 
    String[] ARGS={String.valueOf(Phone.TYPE_MOBILE)};
    Cursor c=a.managedQuery(Phone.CONTENT_URI,
                            PROJECTION, Phone.TYPE+"=?",
                            ARGS, Contacts.DISPLAY_NAME);
     
    SimpleCursorAdapter adapter=new SimpleCursorAdapter(a,
                                    android.R.layout.simple_spinner_item,
                                    c,
                                    new String[] {
                                      Contacts.DISPLAY_NAME
                                    }, 
                                    new int[] { 
                                      android.R.id.text1
                                    }); 
                                     
    adapter.setDropDownViewResource(
7
CodeRank
This code example shows how to use the following methods:managedQuery
class NewContactsAdapterBridge extends ContactsAdapterBridge { 
	ListAdapter buildNameAdapter(Activity a) {
		String[] PROJECTION=new String[] {	Contacts._ID,
																				Contacts.DISPLAY_NAME,
																			}; 
		Cursor c=a.managedQuery(Contacts.CONTENT_URI,
														PROJECTION, null, null, null);
		 
		return(new SimpleCursorAdapter( a,
																		android.R.layout.simple_list_item_1,
																		c,
																		new String[] {
																			Contacts.DISPLAY_NAME
																		}, 
																		new int[] { 
																			android.R.id.text1
																		})); 
	} 
	 
	ListAdapter buildPhonesAdapter(Activity a) {
6
CodeRank
This code example shows how to use the following methods:managedQuery
class OldContactsAdapterBridge extends ContactsAdapterBridge { 
	ListAdapter buildNameAdapter(Activity a) {
		String[] PROJECTION=new String[] {	Contacts.People._ID,
																				Contacts.PeopleColumns.NAME
																			}; 
		Cursor c=a.managedQuery(Contacts.People.CONTENT_URI,
														PROJECTION, null, null,
														Contacts.People.DEFAULT_SORT_ORDER);
		 
		return(new SimpleCursorAdapter( a,
																		android.R.layout.simple_list_item_1,
																		c,
																		new String[] {
																			Contacts.PeopleColumns.NAME
																		}, 
																		new int[] { 
																			android.R.id.text1
																		})); 
	} 
	 
6
CodeRank
This code example shows how to use the following methods:managedQuery
    String[] PROJECTION=new String[] { Contacts._ID,
                                              Contacts.DISPLAY_NAME,
                                              Phone.NUMBER
                                            }; 
    String[] ARGS={String.valueOf(Phone.TYPE_MOBILE)};
    Cursor c=a.managedQuery(Phone.CONTENT_URI,
                            PROJECTION, Phone.TYPE+"=?",
                            ARGS, Contacts.DISPLAY_NAME);
     
    SimpleCursorAdapter adapter=new SimpleCursorAdapter(a,
                                    android.R.layout.simple_spinner_item,
                                    c,
                                    new String[] {
                                      Contacts.DISPLAY_NAME
                                    }, 
                                    new int[] { 
                                      android.R.id.text1
                                    }); 
                                     
    adapter.setDropDownViewResource(
6
CodeRank
This code example shows how to use the following methods:managedQuery
    String[] PROJECTION=new String[] {  Contacts.Phones._ID,
                                        Contacts.Phones.NAME,
                                        Contacts.Phones.NUMBER
                                      }; 
    String[] ARGS={String.valueOf(Contacts.Phones.TYPE_MOBILE)};
    Cursor c=a.managedQuery(Contacts.Phones.CONTENT_URI,
                            PROJECTION,
                            Contacts.Phones.TYPE+"=?", ARGS,
                            Contacts.Phones.NAME);
     
    SimpleCursorAdapter adapter=new SimpleCursorAdapter(a,
                                    android.R.layout.simple_spinner_item,
                                    c,
                                    new String[] {
                                      Contacts.Phones.NAME
                                    }, 
                                    new int[] { 
                                      android.R.id.text1
                                    }); 
                                     
6
CodeRank

Related Activity managedQuery Questions & Answers:

Other Activity managedQuery Examples

46:	        + " COLLATE LOCALIZED ASC";
47:	
48:	    return managedQuery(uri, projection, selection, selectionArgs,
49:	        sortOrder);
50:	  }

Read More

managedQuery Method Overview
This method was deprecated in API level 11. Use CursorLoader instead.
See Code Examples for other Android Activity Methods: