在android中如何将微调器选择值保存到数据库?
我正在尝试将数据库值获取到微调器,这很好。我还将微调器选定值保存到另一个数据库中。 这是从数据库获取数据到微调器的代码在android中如何将微调器选择值保存到数据库?,android,database,spinner,Android,Database,Spinner,我正在尝试将数据库值获取到微调器,这很好。我还将微调器选定值保存到另一个数据库中。 这是从数据库获取数据到微调器的代码 private void filldata() { Cursor docdetailsCursor; Spinner docdetailsSpinner = (Spinner) findViewById(R.id.doctornamespinner); docdetailsCursor = mDbHelper1.fetchAlldetails();
private void filldata()
{
Cursor docdetailsCursor;
Spinner docdetailsSpinner = (Spinner) findViewById(R.id.doctornamespinner);
docdetailsCursor = mDbHelper1.fetchAlldetails();
startManagingCursor( docdetailsCursor);
/*Create an array to specify the fields we want to display in the list (only the 'colourName' column in this case) */
String[] from = new String[]{DoctorDb.KEY_NAME};
/* and an array of the fields we want to bind those fields to (in this case just the textView 'tvDBViewRow' from our new db_view_row.xml layout above) */
int[] to = new int[]{R.id.text1};
SimpleCursorAdapter docdetailsAdapter =
new SimpleCursorAdapter(this, R.layout.spinner_row, docdetailsCursor, from, to);
/* and assign it to our Spinner widget */
docdetailsSpinner.setAdapter(docdetailsAdapter);
}
在这里,我试图获得微调器值并打印
String dosage_type = mPill_pattern.getSelectedItem().toString();
System.out.println("spinner:"+ mPres_doctor);
当我打印微调器选择值时,我得到
10-07 09:52:20.084: INFO/System.out(5500): spinner:android.widget.Spinner@43f04420
任何人都可以知道这个问题的解决方案。请提供一些代码。我们无法确定代码中是否存在问题,否则,即使日志似乎也不完整。。。。请提供您的问题的更多细节。同意:没有代码没有人能够帮助您,可能有很多原因请使用code.ho删除我编辑的问题。抱歉,这是字符串pres\u doctor=mPres\u doctor.getSelectedItem.toString;