SMSReceiver put to SQLite database
===

I created a receiver to get sms messages and add them to my SQLite database.

When I send the sms in the emulator I get java.lang.classnotfoundexception
and the application crashes.The application crash because of the db.addMessage code... because when I remove it and I just put a simple Toast it runs great.. 

I just need my incoming sms to be saved on my database any help would be appresiated...

Thank you for your time.
    
    import java.util.StringTokenizer;
    
    import android.content.BroadcastReceiver;
    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;
    import android.telephony.SmsMessage;
    
    public class SMSReceiver extends BroadcastReceiver {
    
    	@Override
    	public void onReceive(Context context, Intent intent) {
    
    		// ---get the SMS message passed in---
    		Bundle bundle = intent.getExtras();
    		SmsMessage[] msgs = null;
    		String str = "";
    		Databasehandler db = new Databasehandler(context);
    
    		if (bundle != null) {
    
    			// ---retrieve the SMS message received---
    			Object[] pdus = (Object[]) bundle.get("pdus");
    			msgs = new SmsMessage[pdus.length];
    
    			for (int i = 0; i < msgs.length; i++) {
    				msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
    				str += "SMS from " + msgs[i].getOriginatingAddress();
    				str += " :";
    				str += msgs[i].getMessageBody().toString();
    				str += "\n";
    			}
    
    			StringTokenizer stringTokenizer = new StringTokenizer(str);
    			android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss",
    					new java.util.Date());
    			String body = "";
    			String number = stringTokenizer.nextToken();
    			while (stringTokenizer.hasMoreTokens()) {
    				body.concat(stringTokenizer.nextToken());
    			}
    
    			db.addMessage(new Message(number, body, 1, false,
    					(String) android.text.format.DateFormat.format(
    							"yyyy-MM-dd hh:mm:ss", new java.util.Date())));
    
    		//	Toast.makeText(context, number + body, Toast.LENGTH_SHORT).show();
    
    			// to do send to base
    
    			
                     db.close();
    		}
    	}
    }

