Mas ele da erro e não consigo identificar a causa ... o problema é nullPointException ... percorri o cursor e realmente ele trouxe os dados.
VIEW
<Spinner
android:id="@+id/grau_severidade"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:prompt="@string/prompt" />
ACTIVITY
grau_comprometimento = (Spinner) findViewById(R.id.grau_severidade);
Cursor cursor = getListaGrauComprometimento();
String[] de = new String[]{cursor.getColumnName(1)};
int[] para = new int[]{android.R.id.text1};
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item,
cursor, de, para);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
grau_comprometimento.setAdapter(adapter);
ALGUÉM CONSEGUE ME AJUDAR?
-- You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.







0 comentários:
Postar um comentário