大家好,正在学习安卓,不过安卓的logcat有问题,可是程序没问题

Bearnerd 发布于 2016/02/10 12:39
阅读 356
收藏 0

//程序片段,下面还有logcat,创建的时候这句话不打印,我在DDMS里面已经把.db文件删除了

package com.example.createdatabase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class MySqlListOpenHelp extends SQLiteOpenHelper {

    public MySqlListOpenHelp(Context context) {
        //context : 上下文                                                             
        //name   : 数据库的名称
        //factory : 创建一个游标对象 ,默认为null   
        //version: 版本,如果发生改变,调用 onUpgrade
        super(context, "info.db", null, 1);
        // TODO Auto-generated constructor stub
    }
    //oncreate 方法是数据库第一次创建的时候被调用;特别适合做表结构的初始化,需要执行sql语句
    
    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
      System.out.print("creat the data base");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub

    }

}


//logcat

02-09 23:32:14.324: D/AndroidRuntime(2152): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-09 23:32:14.324: D/AndroidRuntime(2152): CheckJNI is ON
02-09 23:32:14.354: D/dalvikvm(2152): Trying to load lib libjavacore.so 0x0
02-09 23:32:14.364: D/dalvikvm(2152): Added shared lib libjavacore.so 0x0
02-09 23:32:14.385: D/dalvikvm(2152): Trying to load lib libnativehelper.so 0x0
02-09 23:32:14.385: D/dalvikvm(2152): Added shared lib libnativehelper.so 0x0
02-09 23:32:14.445: E/cutils-trace(2152): Error opening trace file: No such file or directory (2)
02-09 23:32:14.744: D/AndroidRuntime(2152): Calling main entry com.android.commands.pm.Pm
02-09 23:32:14.764: D/AndroidRuntime(2152): Shutting down VM
02-09 23:32:14.764: D/dalvikvm(2152): Debugger has detached; object registry had 1 entries
02-09 23:32:15.405: D/AndroidRuntime(2173): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-09 23:32:15.415: D/AndroidRuntime(2173): CheckJNI is ON
02-09 23:32:15.445: D/dalvikvm(2173): Trying to load lib libjavacore.so 0x0
02-09 23:32:15.455: D/dalvikvm(2173): Added shared lib libjavacore.so 0x0
02-09 23:32:15.495: D/dalvikvm(2173): Trying to load lib libnativehelper.so 0x0
02-09 23:32:15.495: D/dalvikvm(2173): Added shared lib libnativehelper.so 0x0
02-09 23:32:15.595: E/cutils-trace(2173): Error opening trace file: No such file or directory (2)
02-09 23:32:16.035: D/AndroidRuntime(2173): Calling main entry com.android.commands.am.Am
02-09 23:32:16.035: D/dalvikvm(2173): Note: class Landroid/app/ActivityManagerNative; has 163 unimplemented (abstract) methods
02-09 23:32:16.065: I/ActivityManager(276): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.createdatabase/.MainActivity} from pid 2173
02-09 23:32:16.085: D/(276): HostConnection::get() New Host Connection established 0x2a33a180, tid 558
02-09 23:32:16.155: D/(276): HostConnection::get() New Host Connection established 0x2a3a80c0, tid 560
02-09 23:32:16.175: D/dalvikvm(276): GC_FOR_ALLOC freed 46K, 37% free 6764K/10700K, paused 51ms, total 53ms
02-09 23:32:16.175: I/dalvikvm-heap(276): Grow heap (frag case) to 7.335MB for 566416-byte allocation
02-09 23:32:16.225: D/dalvikvm(276): GC_FOR_ALLOC freed 1K, 36% free 7315K/11256K, paused 49ms, total 49ms
02-09 23:32:16.275: D/dalvikvm(276): GC_FOR_ALLOC freed 0K, 36% free 7315K/11256K, paused 46ms, total 46ms
02-09 23:32:16.284: I/dalvikvm-heap(276): Grow heap (frag case) to 7.875MB for 566416-byte allocation
02-09 23:32:16.335: D/dalvikvm(276): GC_FOR_ALLOC freed 0K, 34% free 7869K/11812K, paused 55ms, total 55ms
02-09 23:32:16.385: D/dalvikvm(276): GC_FOR_ALLOC freed 1106K, 43% free 6762K/11812K, paused 47ms, total 47ms
02-09 23:32:16.405: D/AndroidRuntime(2173): Shutting down VM
02-09 23:32:16.415: D/jdwp(2173): Got wake-up signal, bailing out of select
02-09 23:32:16.415: D/dalvikvm(2173): Debugger has detached; object registry had 1 entries
02-09 23:32:16.474: W/EGL_emulation(803): eglSurfaceAttrib not implemented


加载中
返回顶部
顶部