Android ResourceCursorAdapter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ResourceCursorAdapter class.

This code example shows how to use the following methods:setDropDownViewResource
    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
                                    }); 
                                     
    adapter.setDropDownViewResource(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
7
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
7
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
7
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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
                                    }); 
                                     
    adapter.setDropDownViewResource(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
7
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
        final int[] to = new int[] { android.R.id.text1 };
        final Cursor cursor = adapter.fetchAll();
 
        // not sure about managing cursors for later versions of Android 
        activity.startManagingCursor(cursor);
        final SimpleCursorAdapter ad = new SimpleCursorAdapter(activity, R.layout.simple_spinner_item, cursor, from, to);
        ad.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
 
        final Spinner spinner = (Spinner)activity.findViewById(id);
        spinner.setAdapter(ad);
        spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            public void onItemSelected(final AdapterView<?> adapterView, final View view, final int i, final long l) {
                final Cursor c = (Cursor) spinner.getSelectedItem();
                if (c != null) {
                    final int index = c.getColumnIndex(value);
                    if (index >= 0) listener.select(c.getString(index));
                } 
            } 
 
            public void onNothingSelected(final AdapterView<?> adapterView) {
5
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
		 
		if (fetchedTransactionAmount != 0)
			mTransactionAmountEditText.setText("" + fetchedTransactionAmount);
		 
		model = getAllCategories();
        SimpleCursorAdapter ModelAdapter = new SimpleCursorAdapter(this,
        		   android.R.layout.simple_spinner_item, model,
        		   new String[] {"category_name"},       
        		   new int[] {android.R.id.text1});
         
        ModelAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        mCategorySpinner.setAdapter(ModelAdapter);
        trans_cat = model.getString(1);
 
 
        mCategorySpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
            public void onItemSelected(AdapterView<?> parent, View view, int position, long i) {
                //updateCategorySelection(); 
            	item = parent.getItemAtPosition(position);
            	trans_cat = model.getString(1);
4
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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
                                    }); 
                                     
    adapter.setDropDownViewResource(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
5
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
5
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
5
CodeRank
This code example shows how to use the following methods:setDropDownViewResource
    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
                                    }); 
                                     
    adapter.setDropDownViewResource(
            android.R.layout.simple_spinner_dropdown_item);
     
    return(adapter);
  } 
} 
5
CodeRank

Related Android ResourceCursorAdapter Questions & Answers:

See Code Examples for Android ResourceCursorAdapter Methods: