Many thanks

On 13 abr, 18:50, Kostya Vasilyev <[email protected]> wrote:
> 13.04.2011 19:44, ABSOLUT пишет:
>
> > One newbie question, If I would like that the "SQLiteDatabase db"
> > could use in other functions, how does I initialize in the OnCreate?
>
> class MyActivity {
>
> // Declare the variables in the class, outside any method
> // This way they are accessible to all methods in the class
>
> base baseDatos;
> SQLiteDatabase db;
>
> @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
>
> // This sets the variables declared above, but not too early
> baseDatos = new base(this,"programacion",null,1);
> db = baseDatos.getWritableDatabase();
>
> }
>
> private void doSomething() {
> // You can access "baseDatos" and "db" here as needed
>
> }
> }
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
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