Thank you Dan !

All is ok.

Merci, Monsieur

Tung.

On Fri, Apr 4, 2008 at 6:13 PM, Dan U. <[EMAIL PROTECTED]> wrote:

>
> The problem is that you have an id attribute in your
> result_reading.xml of id="cau_10_answer_reading" instead of id="@+id/
> cau_10_answer_reading". There is also a similar problem with
> result_listening.xml and result_vocabulary.xml
>
> On Apr 4, 1:09 am, "LE THANH TUNG" <[EMAIL PROTECTED]> wrote:
> > I can send you my application folder if you want to !
> >
> > On Fri, Apr 4, 2008 at 2:57 PM, LE THANH TUNG <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Thank you Dan. It's nice. I just try not to bother you.
> >
> > > Please see Resume_reading.java (I don't post grammar.java in another
> > > package because it runs well)
> >
> > > *Resume.java :*
> >
> > > package com.google.tung.englishtest.reading;
> >
> > > import com.google.tung.englishtest.R;
> > > import android.app.Activity;
> > > import android.content.Intent;
> > > import android.os.Bundle;
> > > import android.view.View;
> > > import android.view.View.OnClickListener;
> > > import android.widget.Button;
> > > import android.widget.TextView;
> >
> > > public class Resume_reading extends Activity {
> >
> > >     static char[]     AnswerList = new char[10];
> > >     char[]            RightAnswerList = new
> > > char[]{'a','c','c','a','b','c','a','b','c','b'};
> > >     TextView[]        AnswerTextView = new TextView[10];
> > >     TextView          ResultTextView;
> > >     TextView          Right_Answer_Number;
> >
> > >     protected void onCreate(Bundle icicle)
> > >     {
> > >         super.onCreate(icicle);
> > >         setContentView(R.layout.result_reading);
> >
> > >         setAnswerList();
> > >         setAnswerListTextView();
> >
> > >         ResultTextView =
> > > (TextView)this.findViewById(R.id.result_reading_passed);
> > >         Right_Answer_Number =
> > > (TextView)this.findViewById(R.id.number_right_answer_reading);
> >
> > >         setResult();
> >
> > >         Button ReviewButton =
> > > (Button)findViewById(R.id.button_review_reading);
> > >         ReviewButton.setOnClickListener(reviewClick);
> > >         Button takeAnotherPartButton =
> > > (Button)findViewById(R.id.take_another_part_reading);
> > >         takeAnotherPartButton.setOnClickListener(takeAnotherPart);
> >
> > >    }
> >
> > >    private void setAnswerList() {
> >
> > >            //assign AnswerList[10]
> >
> > >            AnswerList[0] = Cau_1_reading.getCau_1_Answer();
> > >            AnswerList[1] = Cau_2_reading.getCau_2_Answer();
> > >            AnswerList[2] = Cau_3_reading.getCau_3_Answer();
> > >            AnswerList[3] = Cau_4_reading.getCau_4_Answer();
> > >            AnswerList[4] = Cau_5_reading.getCau_5_Answer();
> > >            AnswerList[5] = Cau_6_reading.getCau_6_Answer();
> > >            AnswerList[6] = Cau_7_reading.getCau_7_Answer();
> > >            AnswerList[7] = Cau_8_reading.getCau_8_Answer();
> > >            AnswerList[8] = Cau_9_reading.getCau_9_Answer();
> > >            AnswerList[9] = Cau_10_reading.getCau_10_Answer();
> >
> > >     }
> >
> > >     private void setAnswerListTextView() {
> > >         // Identify TextView on "Your answer:" column
> >
> > >
> AnswerTextView[0]=(TextView)this.findViewById(R.id.cau_1_answer_reading);
> >
> > >
> AnswerTextView[1]=(TextView)this.findViewById(R.id.cau_2_answer_reading);
> >
> > >
> AnswerTextView[2]=(TextView)this.findViewById(R.id.cau_3_answer_reading);
> >
> > >
> AnswerTextView[3]=(TextView)this.findViewById(R.id.cau_4_answer_reading);
> >
> > >
> AnswerTextView[4]=(TextView)this.findViewById(R.id.cau_5_answer_reading);
> >
> > >
> AnswerTextView[5]=(TextView)this.findViewById(R.id.cau_6_answer_reading);
> >
> > >
> AnswerTextView[6]=(TextView)this.findViewById(R.id.cau_7_answer_reading);
> >
> > >
> AnswerTextView[7]=(TextView)this.findViewById(R.id.cau_8_answer_reading);
> >
> > >
> AnswerTextView[8]=(TextView)this.findViewById(R.id.cau_9_answer_reading);
> >
> > >
> AnswerTextView[9]=(TextView)this.findViewById(R.id.cau_10_answer_reading);
> >
> > >     // Display answer in "Your answer:" column
> > >     for(int i=0;i<=9;i++){
> > >         AnswerTextView[i].setText(Character.toString(AnswerList[i]));
> > >     }
> > > }
> >
> > >     private void setResult() {
> > >         //Display result : Passed or not Passed
> > >          int               Result = 0;
> > >           for(int i=0;i<=9;i++){
> > >              if (AnswerList[i] == RightAnswerList[i]) {Result++;}
> > >          }
> >
> > >          if (Result>=5) {ResultTextView.setText("Passed");}
> > >          else {ResultTextView.setText("Not passed");};
> > >          Right_Answer_Number.setText(Integer.toString(Result));
> >
> > >     }
> >
> > >    private OnClickListener reviewClick = new OnClickListener()
> > >     {
> > >        public void onClick(View v)
> > >         {
> > >      //        Here we start the next activity
> > >             Intent intent = new Intent();
> > >             intent.setClass(Resume_reading.this, Cau_1_reading.class);
> > >             startActivity(intent);
> > >             finish();
> >
> > >         }
> > >     };
> > >     private OnClickListener takeAnotherPart = new OnClickListener()
> > >     {
> > >         public void onClick(View v)
> > >         {
> > >             // Here we start the next activity
> > >             Intent intent = new Intent();
> >
> > >
> intent.setClass(Resume_reading.this,com.google.tung.englishtest.Introduction.class);
> > >             startActivity(intent);
> > >             finish();
> >
> > >         }
> > >     };
> >
> > >     }
> >
> > > *result_reading.xml* :
> >
> > > <?xml version="1.0" encoding="utf-8"?>
> >
> > > <RelativeLayout
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="vertical"
> >
> > > <TableLayout
> > > id="@+id/table_result_1_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="vertical"
> >
> > > <TableRow
> > > id="@+id/result_head_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > id="@+id/result_head_question_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="Question :"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/result_head_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="Your answer :"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/result_head_right_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="Right answer :"
> >
> > > </TextView>
> > > </TableRow>
> > > <TableRow
> > > id="@+id/cau_1_row_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="1"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_1_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_1_result_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="a"
> >
> > > </TextView>
> > > </TableRow>
> > > <TableRow
> > > id="@+id/cau_2_row_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="2"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_2_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_2_result_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="c"
> >
> > > </TextView>
> > > </TableRow>
> > > <TableRow
> > > id="@+id/cau_3_row_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="3"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_3_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_3_result_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="c"
> >
> > > </TextView>
> > > </TableRow>
> > > <TableRow
> > > id="@+id/cau_4_row_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="4"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_4_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_4_result_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="a"
> >
> > > </TextView>
> > > </TableRow>
> > > <TableRow
> > > id="@+id/cau_5_row_reading"
> > > android:layout_width="fill_parent"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="5"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_5_answer_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> >
> > > </TextView>
> > > <TextView
> > > id="@+id/cau_5_result_reading"
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> > > android:padding="3dip"
> > > android:text="b"
> >
> > > </TextView>
> > > </TableRow>
> > > <TableRow
> > > id="@+id/cau_6_row_reading"
> > > android:layout_width="275px"
> > > android:layout_height="wrap_content"
> > > xmlns:android="http://schemas.android.com/apk/res/android";
> > > android:orientation="horizontal"
> >
> > > <TextView
> > > android:layout_width="wrap_content"
> > > android:layout_height="wrap_content"
> >
> > ...
> >
> > read more »
> >
>


-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to