【发布时间】:2020-09-02 02:27:26
【问题描述】:
我正在开发一个考勤应用程序。所以我想找回我的卷号。并从我的数据库中命名数据并将其显示在表格布局中,并为每条记录添加 2 个单选按钮(存在和不存在),但我无法这样做。
这是我的代码:
package com.example.attendance;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
public class Take_attendance1 extends AppCompatActivity {
TextView st_roll,st_name;
Databases db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_take_attendance1);
db = new Databases(this);
st_roll = (TextView)findViewById(R.id.st_roll1);
st_name = (TextView)findViewById(R.id.st_name1);
String course = getIntent().getStringExtra("coursesel");
String sem = getIntent().getStringExtra("semsel");
db = new Databases(this);
StringBuilder stringBuilder[] = db.getStudentData(course,sem);
st_roll.setText(stringBuilder[1]); //for roll no
st_name.setText(stringBuilder[2]); //for name
}
}
这是我的应用程序的快照:
现在我想要所有记录的单选按钮,但它只显示第一个。
【问题讨论】:
标签: android sqlite android-studio radio-button tableview