我的应用程序给出了一些关于sqlite的错误,我无法连接数据库

时间:2014-04-14 19:34:17

标签: java android sqlite

This is my database java file
   package net.dictionary.anilerdogan;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class MyDBHelper extends SQLiteOpenHelper {
    final protected static String DATABASE_NAME="kamusmm10";
    public MyDBHelper(Context context) {
        super(context, DATABASE_NAME, null,1);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        //turkish table
                db.execSQL("CREATE TABLE turkish (" +
                        "ilksatir TEXT," +
                        "kelime TEXT," +
                        "anlami TEXT," +
                        ");");

        /************* turkish - start insert data *******************/
                //turkish word datas
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kitap','book');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('araba','car');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('merhaba','hello');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('feel','hissetmek');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('ağaç','tree');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('ev','house');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('uçak','plane');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kapı','door');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('telefon','phone');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('tren','train');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('nefret etmek','hate');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('domates','tomato');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('yatak','bed');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('televizyon','television');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('para','money');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('spor','sport');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('skor','score');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('not','note');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('monitör','monitor');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('anahtar','key');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kod','code');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('veritabani','database');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kalem','pen');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('okul','school');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('sınıf','class');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('mekan','places');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kalp','heart');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('bir','one');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('puan','point');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('arkadaş','friend');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('top','ball');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('dükkan','shop');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kamyonet','truck');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kablo','wire');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('ağrı kesici','painkiller');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('masa','table');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('sandalye','chair');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('saç','hair');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('cüzdan','wallet');");
                db.execSQL("INSERT INTO turkish (kelime,anlami) VALUES('kart','card');");

                Log.i("DB Helper ","table turkish done");


                //English table
                db.execSQL("CREATE TABLE english(" +
                        "firstRow TEXT," +
                        "word TEXT," +
                        "mean TEXT,"+
                        ");");
                //english word datas
                        db.execSQL("INSERT INTO english (word,mean) VALUES('book','kitap');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('car','araba');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('hello','merhaba');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('hissetmek','feel');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('tree','ağaç');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('house','ev');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('plane','uçak');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('door','kapı');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('phone','telefon');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('train','tren');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('hate','nefret etmek');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('tomato','domates');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('bed','yatak');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('television','televizyon');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('money','para');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('sport','spor');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('score','skor');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('note','not');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('monitor','monitör');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('key','anahtar');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('code','kod');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('database','veritabani');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('pen','kalem');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('school','okul');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('class','sınıf');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('places','mekan');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('heart','kalp');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('one','bir');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('point','puan');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('friend','arkadaş');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('ball','top');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('shop','dükkan');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('truck','kamyonet');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('wire','kablo');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('painkiller','ağrı kesici');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('table','masa');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('chair','sandalye');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('hair','saç');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('wallet','cüzdan');");
                        db.execSQL("INSERT INTO english (word,mean) VALUES('card','kart');");

                Log.i("DB Helper ","table english done");

                //eng-turk joiner table
                db.execSQL("CREATE TABLE engturk (" +

                        "word TEXT," +
                        "anlami TEXT" +");");
                Log.i("DB Helper ","table joiner created");

                /************** engturk - start insert data *******************/

                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('book','kitap');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('car','araba');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('hello','merhaba');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('hissetmek','feel');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('tree','ağaç');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('house','ev');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('plane','uçak');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('door','kapı');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('phone','telefon');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('train','tren');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('hate','nefret etmek');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('tomato','domates');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('bed','yatak');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('television','televizyon');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('money','para');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('sport','spor');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('score','skor');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('note','not');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('monitor','monitör');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('key','anahtar');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('code','kod');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('database','veritabani');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('pen','kalem');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('school','okul');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('class','sınıf');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('places','mekan');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('heart','kalp');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('one','bir');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('point','puan');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('friend','arkadaş');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('ball','top');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('shop','dükkan');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('truck','kamyonet');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('wire','kablo');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('painkiller','ağrı kesici');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('table','masa');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('chair','sandalye');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('hair','saç');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('wallet','cüzdan');");
                db.execSQL("INSERT INTO engturk (word,anlami) VALUES('card','kart');");

                Log.i("DB Helper ","table joiner done");

                //eng-turk joiner table
                db.execSQL("CREATE TABLE turkeng ("+"kelime TEXT,"+"mean TEXT,"+");");
                Log.i("DB Helper ","table joiner created");

                /************** turkeng - start insert data *******************/

                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kitap','book');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('araba','car');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('merhaba','hello');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('feel','hissetmek');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('ağaç','ağaç');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('ev','house');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('uçak','plane');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kapı','door');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('telefon','phone');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('tren','train');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('nefret etmek','hate');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('domates','tomato');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('yatak','bed');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('televizyon','television');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('para','money');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('spor','sport');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('skor','score');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('not','note');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('monitör','monitor');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('anahtar','key');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kod','code');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('veritabanı','database');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kalem','pen');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('okul','school');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('sınıf','class');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('mekan','place');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kalp','heart');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('bir','one');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('puan','point');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('arkadaş','friend');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('top','ball');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('dükkan','shop');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kamyonet','truck');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kablo','wire');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('ağrı kesici','painkiller');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('masa','table');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('sandalye','chair');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('saç','hair');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('cüzdan','wallet');");
                db.execSQL("INSERT INTO engturk (kelime,mean) VALUES('kart','card');");

                Log.i("DB Helper ","table joiner done");
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        if (oldVersion >= newVersion) return;
        db.execSQL("DROP DATABASE IF EXISTS " + DATABASE_NAME +";");
        onCreate(db);
    }
}
  

----------------------------------------------- --------------------------------------------这是english.java文件

package net.dictionary.anilerdogan;

import net.dictionary.anilerdogan.R;

import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class english extends Activity implements OnClickListener {
    // widget 
    protected EditText txtenglish;
    protected Button btnAraa;
    protected TextView tvturk;
    protected MyDBHelper myDBHelper;

    // protected Cursor cursor;
    protected SQLiteDatabase db;
    protected Drawable drawable;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.english);

        txtenglish= (EditText) findViewById(R.id.txtenglish);
        txtenglish.requestFocus();

        btnAraa = (Button) findViewById(R.id.btnAra);
        btnAraa.setOnClickListener(this);

        tvturk = (TextView) findViewById(R.id.vturk);

        // database initial
        myDBHelper = new MyDBHelper(this);
        db = myDBHelper.getReadableDatabase();

    }

    public void onClick(View v) {
        String ueng="";
        String turkish="";
        Cursor ceng;
        //Cursor cjoiner;
        switch (v.getId()) {


        case R.id.btnAra:

            ueng=txtenglish.getText().toString().trim();

            //search for the english word 
            String qeng="SELECT * FROM english WHERE word= '"+ueng+"';";
            Log.i("-----search table english---- ",qeng);
            ceng = db.rawQuery(qeng, null);

            /*if(ceng.getCount()!=0){
                ceng.moveToFirst();

                //get turkish word in joiner table
                String qjoiner ="SELECT * FROM turkeng where mean='"+ueng+"';";
                Log.i("-----search table joiner----- ",qjoiner);
                cjoiner=db.rawQuery(qjoiner, null);

                if(cjoiner.getCount()!=0){
                    cjoiner.moveToFirst();//go to first row
                    turkish=cjoiner.getString(1).toString();

                    tvturk.setText("in Turkish : "+turkish);

                }*/

                String qturk ="SELECT * FROM turkish where anlami='"+ueng+"';";
                Log.i("-----search table turkish---- ",qturk);

                ceng=db.rawQuery(qturk, null);
                ceng.moveToFirst();//go to first row

                tvturk.setText("in Turkish : "+turkish);
            }

                Toast.makeText(getApplicationContext(), "Unfortunately, \'"+ueng+"\' that word does not in db!",Toast.LENGTH_SHORT).show();
                //break;
                //break;
        }
    }
  

----------------------------------------------- --------------------------------------------这是turkish.java文件

package net.dictionary.anilerdogan;


import net.dictionary.anilerdogan.R;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;


public class turkish extends Activity implements OnClickListener {
    // widget - 
    protected EditText txtturk;
    protected Button btnAraa;
    protected TextView tveng;
    protected MyDBHelper myDBHelper;

    // protected Cursor cursor;
    protected SQLiteDatabase db;
    protected Drawable drawable;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.turkish);


        txtturk = (EditText) findViewById(R.id.txtturkish);
        txtturk.requestFocus();

        btnAraa = (Button) findViewById(R.id.btnAra);
        btnAraa.setOnClickListener(this);


        tveng = (TextView) findViewById(R.id.veng);

        // database initial
        myDBHelper = new MyDBHelper(this);
        db = myDBHelper.getReadableDatabase();

    }

    public void onClick(View v) {
        String uturk="",english="";
        //Cursor cjoiner;
        Cursor cturk;
        switch (v.getId()) {


        case R.id.btnAra:

            uturk=txtturk.getText().toString().trim();

            //search for the turkish word 
            String qturk ="SELECT * FROM turkish WHERE kelime='"+uturk+"';";
            Log.i("-----search table turk---- ",qturk);
            cturk = db.rawQuery(qturk, null);

            /*if(cturk.getCount()!=0){
                cturk.moveToFirst();

                //get english word in joiner table
                String qjoiner ="SELECT * FROM engturk where anlami='"+uturk+"';";
                Log.i("-----search table joiner---- ",qjoiner);
                cjoiner=db.rawQuery(qjoiner, null);

                if(cjoiner.getCount()!=0){
                    cjoiner.moveToFirst();//go to first row
                    english=cjoiner.getString(0).toString();

                    tveng.setText("ingilizcesi : "+english);

                }*/

                String qeng ="SELECT * FROM english where word='"+english+"';";
                Log.i("-----search table english---- ",qeng);

                cturk=db.rawQuery(qeng, null);
                cturk.moveToFirst();//go to first row

                tveng.setText("İngilizce anlamı : "+english);

            }
            //else{

                Toast.makeText(getApplicationContext(), "Maalesef, \'"+uturk+"\' adında bir kelime kayıtlı değil!",Toast.LENGTH_SHORT).show();
            //  break;
            //}
            //break;
        }
    }
//}
  

----------------------------------------------- -------------------------------------------- english.xml文件

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:background="@drawable/bd"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1"
    >
    <TableRow>

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/enterenglishword"
            android:textColor="#ffffff" />

    </TableRow>
    <TableRow>
        <EditText android:text="" 
            android:layout_column="0"
            android:id="@+id/txtenglish" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:layout_span="2" android:inputType=""/>

        <Button
            android:id="@+id/btnAra"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="2"
            android:text="@string/btnSearch" />

    </TableRow>
    <TableRow>  

            <TextView
                android:id="@+id/vturk"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_column="0"
                android:text="@string/inturkish"
                android:textColor="#ffffff" />

    </TableRow>

</TableLayout>
  
turkish.xml file
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:background="@drawable/bd"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1"
    >
    <!-- AdMob -->
    <TableRow>

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/turkcekelimegir"
            android:textColor="#ffffff" />

    </TableRow>
    <TableRow>

        <EditText
            android:id="@+id/txtturkish"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_column="0"
            android:layout_span="2"
            android:inputType="text"
            android:text="" />

        <Button
            android:id="@+id/btnAra"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="2"
            android:text="@string/btnara" />

    </TableRow>
    <TableRow>

            <TextView
                android:id="@+id/veng"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_column="0"
                android:text="@string/ingilizceanlami"
                android:textColor="#ffffff" />

   </TableRow>


</TableLayout>
  

这个应用程序是android中的一个字典,这个程序给出了   像那样的错误;

android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:749)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.widget.TabHost.setCurrentTab(TabHost.java:413)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.widget.TabHost.addTab(TabHost.java:240)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at net.dictionary.anilerdogan.kamusmm.newTabIntent(kamusmm.java:43)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at net.dictionary.anilerdogan.kamusmm.onCreate(kamusmm.java:32)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.app.Activity.performCreate(Activity.java:5243)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
04-14 15:15:07.188: E/AndroidRuntime(1031):     ... 11 more
04-14 15:15:07.188: E/AndroidRuntime(1031): Caused by: android.database.sqlite.SQLiteException: near ")": syntax error (code 1): , while compiling: CREATE TABLE turkish (kelime TEXT,anlami TEXT,);
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1672)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1603)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at net.dictionary.anilerdogan.MyDBHelper.onCreate(MyDBHelper.java:16)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at net.dictionary.anilerdogan.turkish.onCreate(turkish.java:48)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.app.Activity.performCreate(Activity.java:5243)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-14 15:15:07.188: E/AndroidRuntime(1031):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
04-14 15:15:07.188: E/AndroidRuntime(1031):     ... 22 more
04-14 15:15:11.138: I/Process(1031): Sending signal. PID: 1031 SIG: 9

1 个答案:

答案 0 :(得分:0)

在结束括号前删除逗号(,),并删除;方法中的结尾分号(execSQL())。