Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> &lt;Relativelayout&gt; &lt;ScrollView android:layout_marginTop="10dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/didyoudo" android:layout_above="@+id/bardown" android:scrollbarFadeDuration="1000" android:scrollbarSize="12dip"&gt; &lt;TableLayout android:id="@+id/answertable" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="0,*" &gt; &lt;/TableLayout&gt; &lt;/ScrollView&gt; &lt;Relativelayout/&gt; ****************************** JAVA code : **************************** for (k =0; k&lt; questionCount;k++ ) { //tmpDict = trivialist.get(k); Trivia trivia = trivialist.get(k); TableRow row = new TableRow(getApplicationContext()); TextView tv1 = new TextView(getApplicationContext()); TextView tv2 = new TextView(getApplicationContext()); TextView tv3 = new TextView(getApplicationContext()); TextView tv4 = new TextView(getApplicationContext()); desc = trivia.getAnswerDesc(); quizquestion = trivia.getStrQuestion(); tv1.setText("\n\t" + quizquestion); tv1.setTextColor(Color.WHITE); tv1.setSingleLine(false); tv1.setLines(2); tv1.setHorizontallyScrolling(false); tv1.setTextSize(15); tv1.setTypeface(null, Typeface.BOLD); try { //if the below value is null, it means that the selected answer is wrong // and enters to the else block if (triviaDict.get("correctAnswer") != null) { String answer = (String) triviaDict.get("correctAnswer"); tv2.setText("\n\t" + "You said: "+ answer + "\n"); tv2.setTextColor(Color.WHITE); tv2.setSingleLine(false); tv2.setHorizontallyScrolling(false); tv2.setTextSize(15); tv2.setLines(2); tv2.setTypeface(null, Typeface.BOLD); tv3.setText("\t" +"That's Right."+ desc+"\n"); tv3.setTextColor(Color.WHITE); tv3.setSingleLine(false); tv3.setHorizontallyScrolling(false); tv3.setTextSize(15); tv3.setLines(2); tv3.setTypeface(null, Typeface.BOLD); tv4.setText("\t" + "_____________________________________" ); tv4.setTextColor(Color.WHITE); tv3.setHorizontallyScrolling(false); tv4.setTypeface(null, Typeface.BOLD); } else { String wronganswer = (String) triviaDict.get("selected"); tv2.setText("\n\t" + "You said:"+ wronganswer +"\n" ); tv2.setTextColor(Color.WHITE); tv2.setTextSize(15); tv2.setLines(2); tv2.setSingleLine(false); tv2.setTypeface(null, Typeface.BOLD); tv3.setText("\t" + "Actually," + desc +"\n"); tv3.setTextColor(Color.WHITE); tv3.setTextSize(15); tv3.setLines(2); tv3.setSingleLine(false); tv3.setTypeface(null, Typeface.BOLD); tv4.setText("\t" + "_____________________________________" ); tv4.setTextColor(Color.WHITE); tv3.setHorizontallyScrolling(false); tv4.setTypeface(null, Typeface.BOLD); } } catch (Exception e) { e.printStackTrace(); } tv1.setLayoutParams(new TableRow.LayoutParams(0, android.view.ViewGroup.LayoutParams.WRAP_CONTENT,10)); tv2.setLayoutParams(new TableRow.LayoutParams(0, android.view.ViewGroup.LayoutParams.WRAP_CONTENT,10)); tv3.setLayoutParams(new TableRow.LayoutParams(0, android.view.ViewGroup.LayoutParams.WRAP_CONTENT,10)); tv4.setLayoutParams(new TableRow.LayoutParams(0, android.view.ViewGroup.LayoutParams.WRAP_CONTENT,10)); row.addView(tv1); row.addView(tv2); row.addView(tv3); row.addView(tv4); answerTable.addView(row); } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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