/**
 * 
 */
package com.cj.votron;

import java.util.ArrayList;
import java.util.Arrays;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * @author gvamos
 *
 */
public class ElectionsActivity extends Activity {
	  private ListView electionListView ;  
	  private ArrayAdapter<String> listAdapter ;  
	
	  @Override  
	  public void onCreate(Bundle savedInstanceState) {  
	    super.onCreate(savedInstanceState); 
	    Log.i(this.getClass().getName(),":onCreate");
	    setContentView(R.layout.activity_elections);  
	      
	    // Find the ListView resource.   
	    electionListView = (ListView) findViewById( R.id.electionsListView );  
	  
	    // Create and populate a List of planet names.  
	    String[] planets = new String[] { "London", "Paris", "Chatsworth" };    
	    ArrayList<String> planetList = new ArrayList<String>();  
	    planetList.addAll( Arrays.asList(planets) );  
	      
	    // Create ArrayAdapter using the planet list.  
	    listAdapter = new ArrayAdapter<String>(this, R.layout.simplerow, planetList);  
	      
	    // Add more planets. If you passed a String[] instead of a List<String>   
	    // into the ArrayAdapter constructor, you must not add more items.   
	    // Otherwise an exception will occur.  
	    listAdapter.add( "Foo" );  
	    listAdapter.add( "Bar" );  
	    listAdapter.add( "Baz" );  
  
	      
	    // Set the ArrayAdapter as the ListView's adapter.  
	    electionListView.setAdapter( listAdapter );        
	  }  	
	
}

@@ -311,16 +311,18 @@
 ivity %7B%0A
+%09%0A
 %09  priva
@@ -400,17 +400,58 @@
 apter ; 
- 
+%09  %0A%09  private Config.Elections elections;
 %0A%09%0A%09  @O
@@ -662,446 +662,229 @@
 s); 
- 
 %0A%09    
-  
-%0A
 %09    
-// Find the ListView resource.   %0A%09    electionListView = (ListView) findViewById( R.id.electionsListView );  %0A%09  %0A%09    // Create and populate a List of planet names.
+  %0A%09    elections = Config.getInstance().getElections();%0A%09    elections.updateElections();
   %0A
-%09
   
+%09
   
-String%5B%5D planets = new String%5B%5D %7B %22London%22, %22Paris%22, %22Chatsworth%22 %7D;    %0A%09    ArrayList%3CString%3E planetList = new ArrayList%3CString%3E();  %0A%09    planetList.addAll( Arrays.asList(planets)
+    %0A%09    // Shave the yak.  %0A%09    electionListView = (ListView) findViewById( R.id.electionsListView
  );  
-%0A%09  
+%09
     %0A
-%09    // Create ArrayAdapter using the planet list.  %0A
 %09   
@@ -953,396 +953,40 @@
 ow, 
-planetList);  %0A%09      %0A%09    // Add more planets. If you passed a String%5B%5D instead of a List%3CString%3E   %0A%09    // into the ArrayAdapter constructor, you must not add more items.   %0A%09    // Otherwise an exception will occur.  %0A%09    listAdapter.add( %22Foo%22 );  %0A%09    listAdapter.add( %22Bar%22 );  %0A%09    listAdapter.add( %22Baz%22 );  %0A  %0A%09      %0A%09    // Set the ArrayAdapter as the ListView's adapter.
+(elections.getElectionsList()));
   %0A%09
@@ -1045,16 +1045,15 @@
    %0A
+
 %09  %7D  %09
-%0A
 %09%0A%7D%0A

Refactor to use central config object