ListView list;
SQLiteDatabase PTLM;
@ Override
Public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
Putongliangmadatabase data=https://bbs.csdn.net/topics/new putongliangmadatabase (getActivity ());
PTLM=data. GetWritableDatabase ();
Cursor Cursor=PTLM. Query (" putongliangma ", null, "putong2haoma",
New String [] {}, null, null, null);
While (cursor. MoveToNext ()) {
SimpleCursorAdapter adpter=new SimpleCursorAdapter (
GetActivity (), R.l ayout putong1_item, cursor, new String [] {putong2haoma ", "
"Putong2dangqian", "putong2shangchi putong2zuida", ""},
New int [] {R.i d.p utong1_haomax, R.i d.p utong1_dangqianx, R.i d.p utong1_shangchix, R.i d.p utong1_zuidax},
SimpleCursorAdapter. FLAG_REGISTER_CONTENT_OBSERVER);
List=(ListView) getView (). The findViewById (R.i d.p utong1_haomalist);
List. SetAdapter (adpter);
}
Return inflater. Inflate (R.l ayout putong1_fragment, null);
}
Public void PTLMTJ (View v) {
ArrayList
ContentValues values=new ContentValues ();
For (int a=1; A. & lt;=12; +)
{
For (int b=1; B & lt;=12; B++)
{
If (a!=b)
{
If (a & lt; B)
{
List. The add (" \ r \ n "+ a +", "+ b);
}
}
}
}
Values. The put (" putong2haoma ", a List).
Values. The put (" putong2dangqian ", 0).
Values. The put (" putong2shangchi ", 0).
Values. The put (" putong2zuida ", 0).
}
}
CodePudding user response:
Values. The put (" putong2haoma ", a List). It is wrong toCodePudding user response:
Contenvalues basic types of data can only be stored, like a string, int, cannot store object or List this stuffCodePudding user response: