Browse files

Adding ContentWrapper objecto to extract contact type name

  • Loading branch information...
1 parent 9ee8015 commit f1205cc666614e0cbb5a8bd3802efe5a1964ebc8 Cesar Bolanos committed Jul 9, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/com/xtrade/android/ContactCreateOrUpdateActivity.java
View
6 src/com/xtrade/android/ContactCreateOrUpdateActivity.java
@@ -5,6 +5,7 @@
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
+import android.database.CursorWrapper;
import android.net.Uri;
import android.os.Bundle;
import android.provider.BaseColumns;
@@ -80,9 +81,10 @@ public boolean onOptionsItemSelected(MenuItem _menuItem) {
// We get the ACTION_TYPE extra which tells us what operation we should perform (Save or Update)
int extra = intent.getIntExtra("ACTION_TYPE", -1);
+ CursorWrapper cursorWrapper = (CursorWrapper) spnContactType.getSelectedItem();
+
String contactName = etxContactName.getText().toString();
- // TODO: Don't know how to get the value from the spinner
- String contactType = "Manager";
+ String contactType = cursorWrapper.getString(cursorWrapper.getColumnIndexOrThrow(ContactTypeColumns.NAME));
String contactEmail = etxContactEmail.getText().toString();
String contactPhone = etxContactPhone.getText().toString();

0 comments on commit f1205cc

Please sign in to comment.