Commits

Anonymous committed d5e89e2

more refactoring based on real schema

Comments (0)

Files changed (14)

android/placeUvote/bin/classes.dex

Binary file modified.

android/placeUvote/bin/com/placeuvote/puvandroid/R$id.class

Binary file modified.

android/placeUvote/bin/com/placeuvote/puvandroid/R$layout.class

Binary file modified.

android/placeUvote/bin/com/placeuvote/puvandroid/R$string.class

Binary file modified.

android/placeUvote/bin/placeUvote.apk

Binary file modified.

android/placeUvote/bin/resources.ap_

Binary file modified.

android/placeUvote/gen/com/placeuvote/puvandroid/R.java

         public static final int phone=0x7f020004;
     }
     public static final class id {
-        public static final int btnAddLocation=0x7f050007;
-        public static final int btnBrowser=0x7f05001a;
-        public static final int btnCancel=0x7f050009;
-        public static final int btnEmployer=0x7f050017;
-        public static final int btnPhone=0x7f050014;
-        public static final int btnShowList=0x7f05000d;
-        public static final int btnTitle=0x7f050016;
-        public static final int btnUpdate=0x7f050008;
-        public static final int lblAddress=0x7f05001f;
-        public static final int lblContact=0x7f050010;
+        public static final int btnAddLocation=0x7f050008;
+        public static final int btnBrowser=0x7f05001e;
+        public static final int btnCancel=0x7f05000d;
+        public static final int btnEmployer=0x7f05001b;
+        public static final int btnPhone=0x7f050018;
+        public static final int btnShowList=0x7f050011;
+        public static final int btnTitle=0x7f05001a;
+        public static final int btnUpdate=0x7f05000c;
+        public static final int lblAddress=0x7f050023;
+        public static final int lblContact=0x7f050014;
         public static final int lblDescription=0x7f050005;
-        public static final int lblEmail=0x7f050025;
-        public static final int lblEmployer=0x7f05000e;
-        public static final int lblPUVPoll=0x7f05000b;
-        public static final int lblPhone=0x7f050012;
+        public static final int lblEmail=0x7f050007;
+        public static final int lblEmployer=0x7f050012;
+        public static final int lblPUVPoll=0x7f05000f;
+        public static final int lblPhone=0x7f050016;
         public static final int lblPoll=0x7f050001;
-        public static final int lblRating=0x7f05001d;
-        public static final int lblTitle=0x7f050003;
-        public static final int lblWebsite=0x7f050018;
-        public static final int mapmain=0x7f05000a;
-        public static final int spnLocations=0x7f05000c;
+        public static final int lblQuestion=0x7f050003;
+        public static final int lblRating=0x7f050021;
+        public static final int lblTitle=0x7f050009;
+        public static final int lblWebsite=0x7f05001c;
+        public static final int mapmain=0x7f05000e;
+        public static final int spnLocations=0x7f050010;
         public static final int spnPoll=0x7f050002;
-        public static final int tblJobs=0x7f050013;
-        public static final int tblPhone=0x7f050024;
-        public static final int tblRating=0x7f05001c;
-        public static final int tblWeb=0x7f050019;
-        public static final int text1=0x7f050027;
-        public static final int txtAddress=0x7f050020;
-        public static final int txtCity=0x7f050021;
-        public static final int txtContact=0x7f050011;
-        public static final int txtDescription=0x7f050006;
-        public static final int txtEmail=0x7f050026;
-        public static final int txtEmployer=0x7f05000f;
-        public static final int txtPhone=0x7f050015;
-        public static final int txtRating=0x7f05001e;
-        public static final int txtState=0x7f050022;
-        public static final int txtTitle=0x7f050004;
-        public static final int txtWebsite=0x7f05001b;
-        public static final int txtZIP=0x7f050023;
+        public static final int tblJobs=0x7f050017;
+        public static final int tblPhone=0x7f050028;
+        public static final int tblRating=0x7f050020;
+        public static final int tblWeb=0x7f05001d;
+        public static final int text1=0x7f050029;
+        public static final int txtAddress=0x7f050024;
+        public static final int txtCity=0x7f050025;
+        public static final int txtContact=0x7f050015;
+        public static final int txtDescription=0x7f05000b;
+        public static final int txtEmail=0x7f050006;
+        public static final int txtEmployer=0x7f050013;
+        public static final int txtPhone=0x7f050019;
+        public static final int txtQuestion=0x7f050004;
+        public static final int txtRating=0x7f050022;
+        public static final int txtState=0x7f050026;
+        public static final int txtTitle=0x7f05000a;
+        public static final int txtWebsite=0x7f05001f;
+        public static final int txtZIP=0x7f050027;
         public static final int widget28=0x7f050000;
     }
     public static final class layout {
-        public static final int addlocation=0x7f030000;
-        public static final int editlocation=0x7f030001;
+        public static final int addpoll=0x7f030000;
+        public static final int editpoll=0x7f030001;
         public static final int main=0x7f030002;
         public static final int puvdetail=0x7f030003;
         public static final int puvlist=0x7f030004;

android/placeUvote/res/layout/addlocation.xml

-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-android:id="@+id/widget28"
-android:layout_width="fill_parent"
-android:layout_height="fill_parent"
-android:orientation="vertical"
->
-<TextView 
-android:id="@+id/lblPoll"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:text="Poll"
-android:textStyle="bold">
-</TextView>
-
-<Spinner 
-android:id="@+id/spnPoll" 
-android:layout_below="@id/lblPoll" 
-android:layout_width="wrap_content" 
-android:layout_height="wrap_content">
-</Spinner>
-
-<TextView
-android:id="@+id/lblTitle"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content"
-android:text="Title"
-android:textStyle="bold"
-android:layout_below="@+id/spnPoll">
-</TextView>
-
-<EditText
-android:id="@+id/txtTitle"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:layout_below="@+id/lblTitle" 
-android:paddingLeft="10px"
->
-</EditText>
-
-<TextView
-android:id="@+id/lblDescription"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:text="Description"
-android:textStyle="bold"
-android:layout_below="@+id/txtTitle" 
->
-</TextView>
-
-<EditText
-android:id="@+id/txtDescription"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:layout_below="@+id/lblDescription" 
-android:paddingLeft="10px"
->
-</EditText>
-
-<Button 
-android:id="@+id/btnAddLocation" 
-android:layout_below="@id/txtDescription" 
-android:layout_width="wrap_content" 
-android:layout_height="wrap_content" 
-android:text="Add Location">
-</Button>
-
-</RelativeLayout>

android/placeUvote/res/layout/addpoll.xml

+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+android:id="@+id/widget28"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:orientation="vertical"
+>
+<TextView 
+android:id="@+id/lblPoll"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:text="Poll"
+android:textStyle="bold">
+</TextView>
+
+<Spinner 
+android:id="@+id/spnPoll" 
+android:layout_below="@id/lblPoll" 
+android:layout_width="wrap_content" 
+android:layout_height="wrap_content">
+</Spinner>
+
+<TextView
+android:id="@+id/lblQuestion"
+android:layout_width="wrap_content"
+android:layout_height="wrap_content"
+android:text="Question"
+android:textStyle="bold"
+android:layout_below="@+id/spnPoll">
+</TextView>
+
+<EditText
+android:id="@+id/txtQuestion"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:layout_below="@+id/lblQuestion" 
+android:paddingLeft="10px"
+>
+</EditText>
+
+<TextView
+android:id="@+id/lblDescription"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:text="Description"
+android:textStyle="bold"
+android:layout_below="@+id/txtQuestion" 
+>
+</TextView>
+
+<EditText
+android:id="@+id/txtEmail"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:layout_below="@+id/lblEmail" 
+android:paddingLeft="10px"
+>
+</EditText>
+
+<Button 
+android:id="@+id/btnAddLocation" 
+android:layout_below="@id/txtEmail" 
+android:layout_width="wrap_content" 
+android:layout_height="wrap_content" 
+android:text="Add Location">
+</Button>
+
+</RelativeLayout>

android/placeUvote/res/layout/editlocation.xml

-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-android:id="@+id/widget28"
-android:layout_width="fill_parent"
-android:layout_height="fill_parent"
-android:orientation="vertical"
->
-<TextView 
-android:id="@+id/lblPoll"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:text="Poll"
-android:textStyle="bold">
-</TextView>
-
-<Spinner 
-android:id="@+id/spnPoll" 
-android:layout_below="@id/lblPoll" 
-android:layout_width="wrap_content" 
-android:layout_height="wrap_content">
-</Spinner>
-
-<!-- JL: I can't figure out how to get rid of this.  Currently it's not used,
-but if I get rid of it, the form won't come up & I get an error instead.  At
-least it's invisible. -->
-<ListView
-android:id="@android:id/list"
-android:layout_below="@id/spnPoll"
-android:layout_width="300px" 
-android:layout_height="wrap_content" >
-</ListView>
-
-<TextView
-android:id="@+id/lblTitle"
-android:layout_width="wrap_content"
-android:layout_height="wrap_content"
-android:text="Title"
-android:textStyle="bold"
-android:layout_below="@id/spnPoll" >
-</TextView>
-
-<EditText
-android:id="@+id/txtTitle"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:layout_below="@+id/lblTitle" 
-android:paddingLeft="10px"
->
-</EditText>
-
-<TextView
-android:id="@+id/lblDescription"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:text="Description"
-android:textStyle="bold"
-android:layout_below="@+id/txtTitle" 
->
-</TextView>
-
-<EditText
-android:id="@+id/txtDescription"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:layout_below="@+id/lblDescription" 
-android:paddingLeft="10px"
->
-</EditText>
-
-<Button android:id="@+id/btnUpdate" 
-android:layout_below="@id/txtDescription" 
-android:layout_width="wrap_content" 
-android:layout_height="wrap_content" 
-android:text="Update">
-</Button>
-
-<Button android:id="@+id/btnCancel" 
-android:layout_toRightOf="@id/btnUpdate" 
-android:layout_alignTop="@id/btnUpdate" 
-android:layout_width="wrap_content" 
-android:layout_height="wrap_content" 
-android:text="Cancel">
-</Button>
-
-</RelativeLayout>

android/placeUvote/res/layout/editpoll.xml

+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+android:id="@+id/widget28"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:orientation="vertical"
+>
+<TextView 
+android:id="@+id/lblPoll"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:text="Poll"
+android:textStyle="bold">
+</TextView>
+
+<Spinner 
+android:id="@+id/spnPoll" 
+android:layout_below="@id/lblPoll" 
+android:layout_width="wrap_content" 
+android:layout_height="wrap_content">
+</Spinner>
+
+<!-- JL: I can't figure out how to get rid of this.  Currently it's not used,
+but if I get rid of it, the form won't come up & I get an error instead.  At
+least it's invisible. -->
+<ListView
+android:id="@android:id/list"
+android:layout_below="@id/spnPoll"
+android:layout_width="300px" 
+android:layout_height="wrap_content" >
+</ListView>
+
+<TextView
+android:id="@+id/lblTitle"
+android:layout_width="wrap_content"
+android:layout_height="wrap_content"
+android:text="Title"
+android:textStyle="bold"
+android:layout_below="@id/spnPoll" >
+</TextView>
+
+<EditText
+android:id="@+id/txtTitle"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:layout_below="@+id/lblTitle" 
+android:paddingLeft="10px"
+>
+</EditText>
+
+<TextView
+android:id="@+id/lblDescription"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:text="Description"
+android:textStyle="bold"
+android:layout_below="@+id/txtTitle" 
+>
+</TextView>
+
+<EditText
+android:id="@+id/txtDescription"
+android:layout_width="300px"
+android:layout_height="wrap_content"
+android:layout_below="@+id/lblDescription" 
+android:paddingLeft="10px"
+>
+</EditText>
+
+<Button android:id="@+id/btnUpdate" 
+android:layout_below="@id/txtDescription" 
+android:layout_width="wrap_content" 
+android:layout_height="wrap_content" 
+android:text="Update">
+</Button>
+
+<Button android:id="@+id/btnCancel" 
+android:layout_toRightOf="@id/btnUpdate" 
+android:layout_alignTop="@id/btnUpdate" 
+android:layout_width="wrap_content" 
+android:layout_height="wrap_content" 
+android:text="Cancel">
+</Button>
+
+</RelativeLayout>

android/placeUvote/src/com/placeuvote/puvandroid/PUVDatabase.java

     		"SELECT poll._id, poll.key, poll.question, poll.private, "+
     		"poll.anonymous, poll.onechoice, poll.locations, poll.dates, "+
     		"poll.created_on, poll.created_by, poll.last_vote, poll.total_votes, poll.user, poll.email" +
-       		"FROM poll";
+       		"FROM poll where _id =";
+    	private static final String ORDER = " order by createdon desc";
     	/** Cursor constructor */
 		private PollsCursor(SQLiteDatabase db, SQLiteCursorDriver driver,
 				String editTable, SQLiteQuery query) {
 	}
 
 	/**
-	 * Add a new job to the database.  The job will have a status of open.
-	 * @param employer_id	The employer offering the job
-	 * @param title			The job title
-	 * @param description	The job description
+	 * Add a new poll to the database.  The poll will have a status of open.
+	 * @param job_id	The employer offering the poll
+	 * @param question			The poll question
+	 * @param email	The poll email
 	 */
-	public void addLocation(long employer_id, String title, String description){
+	public void addPoll(long poll_id, String question, String email){
 		ContentValues map = new ContentValues();
-		map.put("employer_id", employer_id);
-		map.put("title", title);
-		map.put("description", description);
+		map.put("question", question);
+		map.put("email", email);
 		try{
-			getWritableDatabase().insert("jobs", null, map);
+			getWritableDatabase().insert("polls", null, map);
 		} catch (SQLException e) {
-            Log.e("Error writing new job", e.toString());
+            Log.e("Error writing new poll", e.toString());
 		}
 	}
 
 	/**
 	 * Update a poll in the database.
-	 * @param poll_id		The poll id of the existing poll
-	 * @param employer_id	The employer offering the poll
-	 * @param title			The poll title
-	 * @param description	The poll description
+	 * @param poll_id	The poll id of the existing poll
+	 * @param question	The poll question
+	 * @param email	The poll creators email
 	 */
-	public void editLocation(long poll_id, long employer_id, String title, String description) {
+	public void editPoll(long poll_id, String question, String email) {
 		ContentValues map = new ContentValues();
-		map.put("employer_id", employer_id);
-		map.put("title", title);
-		map.put("description", description);
+		map.put("question", question);
+		map.put("email", email);
 		String[] whereArgs = new String[]{Long.toString(poll_id)};
 		try{
 			getWritableDatabase().update("polls", map, "_id=?", whereArgs);
 		} catch (SQLException e) {
-            Log.e("Error writing new poll", e.toString());
+            Log.e("Error updating existing poll", e.toString());
 		}
 	}
 
         }
 	}
 
+	/** Returns a PollsCursor for a Poll
+     */
+    public PollsCursor getPollDetails(long pollId) {
+    	SQLiteDatabase d = getReadableDatabase();
+    	PollsCursor c = (PollsCursor) d.rawQueryWithFactory(
+			new PollsCursor.Factory(),
+	    	PollsCursor.QUERY + pollId,
+			null,
+			null);
+    	c.moveToFirst();
+        return c;
+    }
+	
     /** Returns a PollsCursor for all Polls
      */
     public PollsCursor getPolls() {
     	SQLiteDatabase d = getReadableDatabase();
     	PollsCursor c = (PollsCursor) d.rawQueryWithFactory(
 			new PollsCursor.Factory(),
-	    	PollsCursor.QUERY,
+	    	PollsCursor.QUERY + PollsCursor.ORDER,
 			null,
 			null);
     	c.moveToFirst();
      * @param pollId The _id of the poll
      */
     public DatesCursor getDates(long pollId) {
-    	String sql = DatesCursor.QUERY + pollId + ' order by datetime';
+    	String sql = DatesCursor.QUERY + pollId + " order by datetime";
     	SQLiteDatabase d = getReadableDatabase();
     	DatesCursor c = (DatesCursor) d.rawQueryWithFactory(
 			new DatesCursor.Factory(),

android/placeUvote/src/com/placeuvote/puvandroid/PollDetail.java

  */
 public class PollDetail extends Activity {
 
-    private static TextView txtTitle;
+    private static TextView txtQuestion;
     private static TextView txtPoll;
-    private static TextView txtDescription;
+    private static TextView txtEmail;
     private static TextView txtContact;
     private static TextView txtPhone;
     private static ImageButton btnPhone;
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.puvdetail);
-        txtTitle = (TextView) findViewById(R.id.txtTitle);
+        txtQuestion = (TextView) findViewById(R.id.txtQuestion);
         txtPoll = (TextView) findViewById(R.id.txtEmployer);
-        txtDescription = (TextView) findViewById(R.id.txtDescription);
+        txtEmail = (TextView) findViewById(R.id.txtEmail);
         txtContact = (TextView) findViewById(R.id.txtContact);
         txtPhone = (TextView) findViewById(R.id.txtPhone);
 
         job = db.getLocationDetails(job_id.longValue());
 
         // fill in the form and display
-        txtTitle.setText(job.getColTitle());
+        txtQuestion.setText(job.getColQuestion());
         txtPoll.setText(job.getColPollName());
-        txtDescription.setText(job.getColDescription());
+        txtEmail.setText(job.getColEmail());
         txtContact.setText(job.getColContactName());
         txtPhone.setText(job.getColPhone());
 
             case 3:
             	// Edit this job
             	// Start the Edit Location Activity, passing this job's id
-                Intent iEdit = new Intent(PollDetail.this, EditLocation.class);
+                Intent iEdit = new Intent(PollDetail.this, EditPoll.class);
                 Bundle bEdit = new Bundle();
                 bEdit.putInt("_id", job_id);
                 iEdit.putExtras(bEdit);

android/placeUvote/src/com/placeuvote/puvandroid/PollList.java

 import android.widget.TableLayout.LayoutParams;
 
 import com.placeuvote.puvandroid.PUVDatabase.LocationsCursor;
-
-
+import com.placeuvote.puvandroid.PUVDatabase.PollsCursor;
 /**
- * MicroLocationsList
+ * PollsList
  */
 public class PollList extends Activity {
 	
-    private static class mjButton extends Button {
-        protected int jrow; // mjButton is just a button that knows which job number it's associated with
+    private static class puvButton extends Button {
+        protected int jrow; // puvButton is just a button that knows which poll number it's associated with
 
-        public mjButton(Context btnContext) {
+        public puvButton(Context btnContext) {
             super(btnContext);
         }
     }
 
-    private static Button btnTitle;
+    private static Button btnQuestion;
     private static Button btnPoll;
     static TableLayout tblLocations;
 
 
-    // Create a button click listener for the Title button.
-    private final Button.OnClickListener btnTitleOnClick = new Button.OnClickListener() {
+    // Create a button click listener for the Question button.
+    private final Button.OnClickListener btnQuestionOnClick = new Button.OnClickListener() {
         public void onClick(View v) {
             // Remove any TextViews we added to the Table
             for (View vw : lstTable) {
                 tblLocations.removeView(vw);
             }
-            fillData(LocationsCursor.SortBy.title);
+            fillData(PollsCursor);
         }
     };
 
             for (View vw : lstTable) {
                 tblLocations.removeView(vw);
             }
-            fillData(LocationsCursor.SortBy.employer_name);
+            fillData(LocationsCursor);
         }
     };
 
-    // Create a button click listener for the Title buttons in the list
+    // Create a button click listener for the Question buttons in the list
     // Clicking on any of these should take us to a detail listing for that
     // job
-    private final Button.OnClickListener onTitleClick = new Button.OnClickListener() {
+    private final Button.OnClickListener onQuestionClick = new Button.OnClickListener() {
         public void onClick(View v) {
             Intent i = new Intent(PollList.this, PollDetail.class);
             Bundle b = new Bundle();
-            mjButton vb = (mjButton) v;
+            puvButton vb = (puvButton) v;
             cursor.moveToPosition(vb.jrow);
             b.putInt("_id", (int) cursor.getColLocationsId());
             i.putExtras(b);
         super.onCreate(savedInstanceState);
         setContentView(R.layout.puvlist);
         tblLocations = (TableLayout) findViewById(R.id.tblJobs);
-        btnTitle = (Button) findViewById(R.id.btnTitle);
-        btnTitle.setText("Title");
-        btnTitle.setOnClickListener(btnTitleOnClick);
+        btnQuestion = (Button) findViewById(R.id.btnQuestion);
+        btnQuestion.setText("Question");
+        btnQuestion.setOnClickListener(btnQuestionOnClick);
         btnPoll = (Button) findViewById(R.id.btnEmployer);
         btnPoll.setText("Poll");
         btnPoll.setOnClickListener(btnPollOnClick);
 
         db = new PUVDatabase(this);
 
-        fillData(LocationsCursor.SortBy.title);
+        fillData(LocationsCursor.SortBy.Question);
     }
 
     /**
     public boolean onCreateOptionsMenu(Menu menu) {
         boolean supRetVal = super.onCreateOptionsMenu(menu);
         menu.add(0, 0, Menu.NONE, getString(R.string.list_menu_back_to_map));
-        menu .add(0, 1, Menu.NONE, getString(R.string.list_menu_sort_by_title));
+        menu .add(0, 1, Menu.NONE, getString(R.string.list_menu_sort_by_Question));
         menu.add(0, 2, Menu.NONE, getString(R.string.list_menu_sort_by_poll));
         menu.add(0, 3, Menu.NONE, getString(R.string.list_menu_add_location));
         return supRetVal;
     }
 
 
-    /**
+    /**Poll
      * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
      */
     @Override
                 finish();
                 return true;
             case 1:
-                // Sort the list by job title
+                // Sort the list by poll Question
                 for (View vw : lstTable) {
                     tblLocations.removeView(vw);
                 }
-                fillData(LocationsCursor.SortBy.title);
+                fillData(PollsCursor.SortBy.Question);
                 return true;
             case 2:
-                // Sort the list by employer name
+                // Sort the list by poll creation date
                 for (View vw : lstTable) {
                     tblLocations.removeView(vw);
                 }
-                fillData(LocationsCursor.SortBy.employer_name);
+                fillData(PollsCursor.SortBy.CreatedOn);
                 return true;
             case 3:
             	// Add a new job
-                Intent i = new Intent(PollList.this, AddLocation.class);
+                Intent i = new Intent(PollList.this, AddPoll.class);
                 startActivity(i);
                  	return true;
         }
         // Keep track of the TextViews added in list lstTable
         cursor = db.getLocations(sortBy);
         // Create a table row that contains two lists
-        // (one for job titles, one for employers)
-        // Now load the lists with job title and employer name
+        // (one for job Questions, one for employers)
+        // Now load the lists with job Question and employer name
         //for (Locations row : rows) {
         for( int rowNum=0; rowNum<cursor.getCount(); rowNum++){
         	cursor.moveToPosition(rowNum);
             tr.setLayoutParams(new LayoutParams(
                 android.view.ViewGroup.LayoutParams.FILL_PARENT,
                 android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
-            // Create a Button for the job title.
-            mjButton btn1 = new mjButton(this);
+            // Create a Button for the job Question.
+            puvButton btn1 = new puvButton(this);
             // Button btn1 = new Button(this);
             btn1.jrow = rowNum;
-            btn1.setText(cursor.getColTitle());
+            btn1.setText(cursor.getColQuestion());
             btn1.setPadding(1, 0, 3, 0);
             btn1.setHeight(40);
             btn1.setGravity(android.view.Gravity.CENTER);
             btn1.setBackgroundColor(colorByStatus((int) cursor.getColStatus()));
-            btn1.setOnClickListener(onTitleClick);
-            // Add job title to job list.
+            btn1.setOnClickListener(onQuestionClick);
+            // Add poll Question to poll list.
             tr.addView(btn1);
 
             Button btn2 = new Button(this);