db4o not updating my object's array list
===

So I've been making this quick texting app for practice with android applications. I've been using eclipse and testing it on my phone. I have everything working apart from one aspect. when the app launches the user is taken to a listview set by the listadapter which takes all the contacts from my db4o database (first activity is 'Qtext'). when you click on a contact, a new activity is started by an intent which has the clicked contact passed to the next activity with 'i.putExtra("New", tempClick)', tempClick being the selected object. The next activity (called ViewContact )definitely   receives the parcelable object. 

In ViewContact I have made an add phrase button which will allow you to add custom phrases. when pressed an alert dialog box asks the name of the phrase, when you enter and press "OK", I add xml through an inflater to my layout, i then set the text of the phrase to whatever the user has inputed in the alert dialog. The inflater works, and the set text works.

Through rigorous testing I have concluded that for some reason my database is not updating, even though it should be. I have read the index tutorial from db4o and have searched a lot for an answer however I have not found one. 

I have posted the code below of the ViewContact class, 

  

    @SuppressLint("ParserError")
	public class ViewContact extends Activity implements View.OnClickListener{
    	
    	//Declare global variables.
    	Button sendText;
    	Button addPhrase;
    
    	String message = "";
    	TextView welcome;
    	String tname = "";
    	String num= "";
    	
    	
    	TextView tempV;
    	CheckBox tempCb;
    	String name;
    	//FOR GETTING PATH TO DB40
    	Context context;
    	private String db4oDBFullPathSdCard(Context ctx) {
    	    File path = new File(Environment.getExternalStorageDirectory(), ".ContactDataBase");
    	    if (!path.exists()) {
    	        path.mkdir();
    	    }
    	    return path + "/" + "ContactDataBase.db4o";
    	}
    	
    	
    	
    	 NewContact t;
   
		
	
	 
	
    	protected void onCreate(Bundle savedInstanceState) {
    		
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.activity_main);
    	
    		//Sets variables.
    		initialiseVars();
    		//Get object from Qtext.
            t = (NewContact) getIntent().getParcelableExtra("New");
    		
           
            //Loop through database and add phrase.
    		
    		  //Open database 
				ObjectContainer db = Db4oEmbedded.openFile(Db4oEmbedded
				        .newConfiguration(), db4oDBFullPathSdCard(context));
		    try {
				    // do something with db4o
		    	
		    	
					//looks through database and adds contacts to display. 
					ObjectSet result = db.queryByExample(new NewContact(t.getName()));
					NewContact found = (NewContact) result.next();
					//getPhrase is always null
					/*
					found.storePhrase("test3"); //this adds, so add button is not storing */
					
						
						/*found.getPhrase will return the objects arraylist of strings, which are all the custom phrases. HERE IT IS NOT DISPLAYING SO .getPhrase returns nothing*/
						for(String i :  found.getPhrase())
				        {
							
						
							
						//buildP adds phrase to layout
					    buildP();
					
						tempV = (TextView) findViewById(R.id.textViewNewP);
						tempCb = (CheckBox) findViewById(R.id.cbNewP);
						
						tempV.setText(i);
						
						
					 
				          }
					
			         
				} 
				
				finally {
				    db.close();
				}
    	
    		
    		
    		
    		
    		//Set name on textview
    		String text = "Message to "+ t.getName() + ":";
    		welcome.setText(text);
    		//Set number to pass to mesage
    		num = t.getNumber();
    		
    		//Onclick listener on sendtext button, and addphrase.
    		sendText.setOnClickListener(this);
    		addPhrase.setOnClickListener(this);
        	}
    		
    		public void buildP()
    		{
    			    LinearLayout mainLayout = (LinearLayout)findViewById(R.id.scrollLayout);
					LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
					View itemBox = inflater.inflate(R.layout.phrase,null);
					mainLayout.addView(itemBox);
    			
    		}
    		
    	
    private void initialiseVars() {
    	
    
    	welcome = (TextView) findViewById(R.id.welcome);
    	sendText = (Button) findViewById(R.id.bSentText);
    	addPhrase = (Button) findViewById(R.id.bAddP);
    //made 't' global just incase bAddP couldnt access 't' from oncreate
    	 t = (NewContact) getIntent().getParcelableExtra("New");
 		//name made to test on bAddP
    	name = t.getName();
    }

   

    @SuppressLint({ "ParserError", "ParserError", "ParserError", "ParserError" })
	public void onClick(View v) {
    	
    	
    	
    	
    	
    	
    	switch(v.getId())
		{
		
    	
    	        //THIS IS THE ADD PHRASE BUTTON
		case R.id.bAddP: 
			
		    
			 
			 
			 
			
			
			//ALERT BOX LAUNCHES
			final AlertDialog.Builder alert = new AlertDialog.Builder(this);

			alert.setTitle("Title");
			alert.setMessage("Message");
 
			// Set an EditText view to get user input 
			final EditText input = new EditText(this);
			alert.setView(input);

                        //THIS IS FOR WHEN OK IS PRESSED
			alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int whichButton) {
			     
                                //VALUE OF USER INPUT
				String value = input.getText().toString();
			  
			  // OPEN DB4O AND UPDATE CONTACT OBJECT
			  ObjectContainer db = Db4oEmbedded.openFile(Db4oEmbedded
				        .newConfiguration(), db4oDBFullPathSdCard(context));
				try {
				    
					//QUERY BY EXAMPLE TO GET CONTACT
                                        //USING "t" WHICH IS PARCELABLE OBJECT PASSED FROM 
                                        //FIRST ACTIVITY
                                        
					ObjectSet result = db.queryByExample(new NewContact(t.getName()));
					NewContact found = (NewContact) result.next();
					//STORE PHRASE STORES A STRING INTO THE OBJECTS 
                                        //ARRAYLIST
                                       found.storePhrase(value);
					//UPDATE DATABASE, 
                                        //THIS IS NOT UPDATING! HERE IS PROBLEM
					db.store(found);
					
					Class ourContact = Class.forName("com.text.q.ViewContacts");
					Intent i = new Intent(ViewContact.this, ourContact);
                                        //REPARCEL OBJECT SO NAME CAN BE USED AGAIN
					i.putExtra("New", t);
					finish();
					startActivity(i);
				       //ENDS ACTIVITY AND STARTS THE SAME ACTIVITY (refresh display)
					
					
				} catch (ClassNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
					
				 finally {
				    db.close();
				}
			  
			
    
    /*});

			alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
				  public void onClick(DialogInterface dialog, int whichButton) {
				    // Canceled.
				  }
				});

			  alert.show();
			
		
			break;
			 
		
    	
		case R.id.bSentText:
    	
    	//Create intent which sends message and number to message application.
    	Intent textIntent = new Intent(Intent.ACTION_SENDTO);
    	textIntent.addCategory(Intent.CATEGORY_DEFAULT);
    	textIntent.setType("vnd.andoid-dir/mms-sms");
    	textIntent.putExtra("sms_body", message);
    	textIntent.setData(Uri.parse("sms:" + num));
    	startActivity(textIntent);
		}
    	
    	
    	
    	
    	

    	
    	
    	
    	

    }
   
    
    
   

    
    }

The problem lies in the onClick method, for bAddP. I'm trying to update the database so that when i end and restart the activity the new phrase will be displayed. I'm very new to app development so any help would be greatly appreciated. I realise this isn't perfect code so any ideas are grateful.
Thanks