Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I setContentView on the basis of data fetched from the table in SQLite?
    primarykey
    data
    text
    <p>This is the <strong>attendance_sheet.xml</strong> file where the number of check boxes is calculated by retrieving the number of students in the 'student_login' table. The name of the check box also should be from the table.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent" &gt; &lt;TableLayout android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;CheckBox android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" XYZ" /&gt; &lt;CheckBox android:id="@+id/checkBox2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" PQR" /&gt; &lt;Button android:id="@+id/bUpdateAttendance" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Submit Attendance" /&gt; &lt;/TableLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>in <strong>DbHelper.class</strong></p> <pre><code>private static final String STUDENT_TABLE_CREATE = "CREATE TABLE " + STUDENT_TABLE + "( s_id INTEGER PRIMARY KEY AUTOINCREMENT , " + "s_name TEXT NOT NULL , s_pass TEXT NOT NULL , " + "s_roll_no TEXT NOT NULL , " + "s_email TEXT NOT NULL);"; </code></pre> <p><strong>TeacherloggedInPage.java</strong></p> <pre><code>protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.attendancesheet); Bundle extras = getIntent().getExtras(); if (savedInstanceState == null) { extras = getIntent().getExtras(); if (extras == null) { t_id = (String) null; } else { t_id = extras.getString("key"); } } else { t_id = (String) savedInstanceState.getSerializable("key"); } UpdateAttendanceButton = (Button) findViewById(R.id.bUpdateAttendance); UpdateAttendanceButton.setOnClickListener(this); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload