Rearrange

This commit is contained in:
Tom Willemsen 2012-08-08 23:07:28 +02:00
parent e8df341197
commit d525b27d44

View file

@ -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();
}
}