Hi,

I cant create SQLLite Database, gives me an FC:

4-13 16:20:48.225: INFO/ActivityManager(67): Start proc com.es.tele for
activity com.es.tele/.tele: pid=490 uid=10034 gids={3003, 1015}
04-13 16:20:51.305: DEBUG/AndroidRuntime(490): Shutting down VM
04-13 16:20:51.314: WARN/dalvikvm(490): threadid=1: thread exiting with
uncaught exception (group=0x40015560)
04-13 16:20:51.374: ERROR/AndroidRuntime(490): FATAL EXCEPTION: main
04-13 16:20:51.374: ERROR/AndroidRuntime(490): java.lang.RuntimeException:
Unable to instantiate activity ComponentInfo{com.es.tele/com.es.tele.tele}:
java.lang.NullPointerException
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.os.Handler.dispatchMessage(Handler.java:99)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.os.Looper.loop(Looper.java:123)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.ActivityThread.main(ActivityThread.java:3683)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
java.lang.reflect.Method.invokeNative(Native Method)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
java.lang.reflect.Method.invoke(Method.java:507)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
dalvik.system.NativeStart.main(Native Method)
04-13 16:20:51.374: ERROR/AndroidRuntime(490): Caused by:
java.lang.NullPointerException
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:100)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
com.es.tele.tele.<init>(tele.java:77)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
java.lang.Class.newInstanceImpl(Native Method)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
java.lang.Class.newInstance(Class.java:1409)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
04-13 16:20:51.374: ERROR/AndroidRuntime(490):     ... 11 more
04-13 16:20:51.445: WARN/ActivityManager(67):   Force finishing activity
com.es.tele/.tele
04-13 16:20:52.005: WARN/ActivityManager(67): Activity pause timeout for
HistoryRecord{40689ca0 com.es.tele/.tele}
04-13 16:20:53.804: DEBUG/dalvikvm(298): GC_EXPLICIT freed 6K, 55% free
2597K/5703K, external 716K/1038K, paused 8701ms
04-13 16:20:58.768: DEBUG/dalvikvm(346): GC_EXPLICIT freed <1K, 54% free
2539K/5511K, external 716K/1038K, paused 360ms
04-13 16:21:03.232: WARN/ActivityManager(67): Activity destroy timeout for
HistoryRecord{40689ca0 com.es.tele/.tele}
04-13 16:21:36.614: INFO/Process(490): Sending signal. PID: 490 SIG: 9
04-13 16:21:36.665: INFO/ActivityManager(67): Process com.es.tele (pid 490)
has died.
04-13 16:21:37.115: WARN/InputManagerService(67): Window already focused,
ignoring focus gain of:
com.android.internal.view.IInputMethodClient$Stub$Proxy@40692d80


I have:
package com.es.tele;

import .....


public class tele extends TabActivity {
    /** Called when the activity is first created. */



    private TextView seleccion;



    private ProgressDialog progressdialog;
    String horaIn;
    String horaFi;
    String canal;
    int posicion;




   base baseDatos = new base(this,"programacion",null,1);
   SQLiteDatabase db = baseDatos.getWritableDatabase();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        tabhost = getTabHost();


And then in the base class:


public  class base extends SQLiteOpenHelper {

        //Sentencia SQL para crear la tabla de Usuarios
        String sqlCreate = "CREATE TABLE LAUNO (codigo INTEGER, programa
TEXT, descripcion TEXT);";

        public base(Context contexto, String nombre,
                                   CursorFactory factory, int version) {
            super(contexto, nombre, factory, version);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            //Se ejecuta la sentencia SQL de creación de la tabla
            db.execSQL(sqlCreate);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int versionAnterior, int
versionNueva) {


            //Se elimina la versión anterior de la tabla
            db.execSQL("DROP TABLE IF EXISTS LAUNO");

            //Se crea la nueva versión de la tabla
            db.execSQL(sqlCreate);
        }

 }


Could you help me please?
Many thanks and sorry for my english!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to