1
0
mirror of https://github.com/balkian/Carrousel-Android.git synced 2024-12-23 05:28:13 +00:00
Carrousel-Android/src/com/onirica/carrousel/Configuration.java

41 lines
1.3 KiB
Java
Raw Normal View History

2011-03-09 21:41:31 +00:00
package com.onirica.carrousel;
2011-03-09 22:33:35 +00:00
import java.util.ArrayList;
2011-03-09 21:41:31 +00:00
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
2011-03-09 21:41:31 +00:00
import android.os.Bundle;
import android.os.IBinder;
2011-03-09 21:41:31 +00:00
public class Configuration extends Activity {
private Results mResults;
2011-03-09 22:33:35 +00:00
private Intent intent;
2011-03-09 21:41:31 +00:00
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
2011-03-09 22:33:35 +00:00
intent = new Intent(getBaseContext(), Results.class);
startService(intent);
ServiceConnection conn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
mResults = ((Results.LocalBinder)service).getService();
2011-03-09 22:33:35 +00:00
populateMatches();
}
@Override
public void onServiceDisconnected(ComponentName className) {
mResults = null;
2011-03-09 22:33:35 +00:00
stopService(intent);
finish();
}
};
bindService(intent, conn, BIND_AUTO_CREATE);
2011-03-09 21:41:31 +00:00
}
2011-03-09 22:33:35 +00:00
private void populateMatches() {
ArrayList<Match> matches = mResults.getMatches();
}
2011-03-09 21:41:31 +00:00
}