我的表中有一列,我希望在列中保存十位数字,我使用char [10]作为列的数据类型,但在android studio中我不知道如何获取CHAR形式的数字来自EditText。
a = dicomread('CT-MONO2-16-ankle.dcm');
a = double(a);
a=a/max(a(:));
figure; imshow(a);
figure; imhist(a);
[N, M] = size(a);
Histo(1:256) = 0;
for n = 1 : N
for m = 1 : M
if a(n,m)+1 ~= floor(a(n,m)+1)%I use this code for find the error
disp(a(n,m)+1);
end
ind = floor(a(n,m)+1);% apprx. to the nearest integer.
Histo(ind) = Histo(ind)+1;
end
end
Histo = Histo/(N*M);
figure; plot(Histo);
数据库页面:
MainActivity :
int classId = tableData.get(position).getClassId();
String studentName = studentName_editText.getText().toString();
String studentId = studentId_et.getText().toString();
DatabaseHandler database = new DatabaseHandler(context);
database.OpenDatabase();
database.SaveStudent(studentId , classId , studentName);
database.close();
答案 0 :(得分:1)
从编辑文本
获取CHAR []形式的数字char[] data = yourEditText.getText().toString().toCharArray();
如果您需要来自editText的单个字符:
char data = yourEditText.getText().toString().charAt(index);
用于从数据库中检索数据
Cursor cursor = database.query(table_name, selectQuery, selection, selectionArgs, group_by_if_any, null, orderBy_if_any);
while (cursor.moveToNext()) {
String mobile_num = cursor.getString(cursor.getColumnIndex("column_name"))
}