@Override
    public void onClick(View v) {
      CharSequence text = mTextEditor.getText();
      if (text.length() == 0) return;
      mTextEditor.setText("");

      if (mConv == null) {
        Contact c = ContactStore.getByNumber(mSubject.getText().toString());
        long threadId = Telephony.Threads.getOrCreateThreadId(SMSApp.getContext(), c.number);
        mConv = new Conversation();
        mConv.contact = c;
        mConv.threadId = threadId;
      }
      sendMessage(text.toString());
      if (mStore == null) {
        mStore = new MessageStore(mConv.threadId, mConv.contact.name);
        mStore.bindView(mHistory);
      }
      mStore.update();
      updateTitleBar();
    }
 @Override
 protected void onPause() {
   Log.d("SimpleSMS", "Called onPause()!");
   ContactStore.exportCache();
   super.onPause();
 }