From d525b27d4492990867ca410d866629760e63925f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 8 Aug 2012 23:07:28 +0200 Subject: [PATCH] Rearrange --- src/ryuslash/org/dvdroid/AddDVDActivity.java | 52 ++++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/ryuslash/org/dvdroid/AddDVDActivity.java b/src/ryuslash/org/dvdroid/AddDVDActivity.java index d25affd..f5244c3 100644 --- a/src/ryuslash/org/dvdroid/AddDVDActivity.java +++ b/src/ryuslash/org/dvdroid/AddDVDActivity.java @@ -14,16 +14,6 @@ public class AddDVDActivity extends Activity { private DVDDataSource datasource; - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - setContentView(R.layout.add); - - datasource = new DVDDataSource(this); - datasource.open(); - } - public void createDVD() { EditText name_entry = (EditText)findViewById(R.id.name_entry); @@ -38,24 +28,13 @@ public class AddDVDActivity extends Activity } @Override - protected void onResume() + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.add); + + datasource = new DVDDataSource(this); datasource.open(); - super.onResume(); - } - - @Override - protected void onPause() - { - datasource.close(); - super.onPause(); - } - - @Override - protected void onDestroy() - { - datasource.close(); - super.onDestroy(); } @Override @@ -66,6 +45,13 @@ public class AddDVDActivity extends Activity return true; } + @Override + protected void onDestroy() + { + datasource.close(); + super.onDestroy(); + } + @Override public boolean onOptionsItemSelected(MenuItem item) { @@ -78,4 +64,18 @@ public class AddDVDActivity extends Activity return false; } + + @Override + protected void onPause() + { + datasource.close(); + super.onPause(); + } + + @Override + protected void onResume() + { + datasource.open(); + super.onResume(); + } }