sqlite数据库显示错误(没有这样的表)

时间:2012-01-23 18:07:22

标签: android

package com.pro;


import android.app.Activity;

import android.content.ContentValues;

import android.content.Intent;

import android.database.sqlite.SQLiteDatabase;

import android.os.Bundle;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;

import android.widget.Toast;



public class SignUpActivity extends Activity implements OnClickListener {

    EditText fname,lname,email,phnum,ad;

    Button save,reset;



    String s1_f,s2_l,s3_p,s4_a,s5_e;

    ContentValues cv=new ContentValues();

    MainDataBase sud;

    SQLiteDatabase newDB;

    String tableName2 = MainDataBase.tableNamee12;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.signup);

        fname=(EditText)findViewById(R.id.Fname);

        lname=(EditText)findViewById(R.id.pass);

        phnum=(EditText)findViewById(R.id.phnnum);

        ad=(EditText)findViewById(R.id.address);

        email=(EditText)findViewById(R.id.email);

        save=(Button)findViewById(R.id.save);

        reset=(Button)findViewById(R.id.Reset);

        save.setOnClickListener(this);

        reset.setOnClickListener(this);

        s1_f=fname.getText().toString();

        s2_l=lname.getText().toString();


        s3_p=phnum.getText().toString();

        s4_a=ad.getText().toString();

        s5_e=email.getText().toString();

        sud=new MainDataBase(this.getApplicationContext());


    }
    public void onClick(View v) {

        // TODO Auto-generated method stub


        if(v==save){

            if(s1_f.equals(null)||s2_l.equals("")||

               s3_p.equals("")||s4_a.equals("")||

               s5_e.equals("")){

                Toast.makeText(this,"fill all the field",5000).show();
            }

            else{


            newDB = sud.getWritableDatabase();

            ContentValues obj_contenValues = new ContentValues();

            obj_contenValues.put(MainDataBase.col_firstName, s1_f);

            obj_contenValues.put(MainDataBase.col_password, s2_l);

            obj_contenValues.put(MainDataBase.col_phone, s3_p);

            obj_contenValues.put(MainDataBase.col_email, s5_e);


            obj_contenValues.put(MainDataBase.col_address, s4_a);

            newDB.insert(tableName2, null, obj_contenValues);

            newDB.close();

            newDB=sud.getReadableDatabase();

            String 
s=obj_contenValues.get(MainDataBase.col_firstName).toString();

            Toast.makeText(this, s, Toast.LENGTH_LONG).show();

            }   
            }


        if(v==reset){

            Intent intent = new Intent(this,SignUpActivity.class);

            startActivity(intent);

        }


        if(v==reset){

        //  fname.setText(null);

    }

}




    }01-23 17:20:53.446: E/Zygote(32): setreuid() failed. errno: 2
01-23 17:21:06.397: E/Zygote(32): setreuid() failed. errno: 17
01-23 17:21:08.657: E/BatteryService(72): usbOnlinePath not found
01-23 17:21:08.657: E/BatteryService(72): batteryVoltagePath not found
01-23 17:21:08.657: E/BatteryService(72): batteryTemperaturePath not found
01-23 17:21:08.696: E/SurfaceFlinger(72): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
01-23 17:22:01.427: E/EventHub(72): could not get driver version for /dev/input/mouse0, Not a typewriter
01-23 17:22:01.427: E/EventHub(72): could not get driver version for /dev/input/mice, Not a typewriter
01-23 17:22:02.377: E/System(72): Failure starting core service
01-23 17:22:02.377: E/System(72): java.lang.SecurityException
01-23 17:22:02.377: E/System(72):   at android.os.BinderProxy.transact(Native Method)
01-23 17:22:02.377: E/System(72):   at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
01-23 17:22:02.377: E/System(72):   at android.os.ServiceManager.addService(ServiceManager.java:72)
01-23 17:22:02.377: E/System(72):   at com.android.server.ServerThread.run(SystemServer.java:184)
01-23 17:22:05.346: E/SoundPool(72): error loading /system/media/audio/ui/Effect_Tick.ogg
01-23 17:22:05.377: E/SoundPool(72): error loading /system/media/audio/ui/KeypressStandard.ogg
01-23 17:22:05.396: E/SoundPool(72): error loading /system/media/audio/ui/KeypressSpacebar.ogg
01-23 17:22:05.420: E/SoundPool(72): error loading /system/media/audio/ui/KeypressDelete.ogg
01-23 17:22:05.420: E/SoundPool(72): error loading /system/media/audio/ui/KeypressReturn.ogg
01-23 17:22:15.106: E/ThrottleService(72): Could not open GPS configuration file /etc/gps.conf
01-23 17:22:15.146: E/ThrottleService(72): Error reading data file
01-23 17:22:16.336: E/logwrapper(153): executing /system/bin/tc failed: No such file or directory
01-23 17:22:16.407: E/logwrapper(158): executing /system/bin/tc failed: No such file or directory
01-23 17:22:16.466: E/logwrapper(159): executing /system/bin/tc failed: No such file or directory
01-23 17:22:24.636: E/logwrapper(166): executing /system/bin/tc failed: No such file or directory
01-23 17:22:24.706: E/logwrapper(167): executing /system/bin/tc failed: No such file or directory
01-23 17:22:24.796: E/logwrapper(168): executing /system/bin/tc failed: No such file or directory
01-23 22:52:52.696: E/HierarchicalStateMachine(72): TetherMaster - unhandledMessage: msg.what=3
01-23 22:52:52.996: E/HierarchicalStateMachine(72): TetherMaster - unhandledMessage: msg.what=3
01-23 22:52:53.166: E/HierarchicalStateMachine(72): TetherMaster - unhandledMessage: msg.what=3
01-23 22:52:53.477: E/HierarchicalStateMachine(72): TetherMaster - unhandledMessage: msg.what=3
01-23 22:53:24.077: E/MetadataRetrieverClient(33): failed to extract an album art
01-23 22:53:44.807: E/ThrottleService(72): Error reading data file

检查我的表格未创建的原因

1 个答案:

答案 0 :(得分:0)

在我看来,好像你在调试器上没有调试,但在真实设备上,该设备有一些实际问题。错误消息具有系统特征。

或者(可能和)您的调试器已经捕获了不是来自您的应用程序的信息。

首先尝试在模拟器上进行调试 - 它更容易。