Search in sources :

Example 6 with Transaction

use of com.moez.QKSMS.mmssms.Transaction in project qksms by moezbhatti.

the class RemoteMessagingReceiver method onReceive.

@Override
public void onReceive(Context context, Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    Bundle bundle = intent.getExtras();
    if (remoteInput != null && bundle != null) {
        if (intent.getAction().equals(ACTION_REPLY)) {
            Message message = new Message(remoteInput.getCharSequence(EXTRA_VOICE_REPLY).toString(), new String[] { bundle.getString(EXTRA_ADDRESS) });
            Transaction sendTransaction = new Transaction(context, SmsHelper.getSendSettings(context));
            sendTransaction.sendNewMessage(message, bundle.getLong(EXTRA_THREAD_ID));
            Intent i = new Intent(context, MarkReadService.class);
            i.putExtra(EXTRA_THREAD_ID, bundle.getLong(EXTRA_THREAD_ID));
            context.startService(i);
        }
    }
}
Also used : Message(com.moez.QKSMS.mmssms.Message) Transaction(com.moez.QKSMS.mmssms.Transaction) Bundle(android.os.Bundle) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent)

Example 7 with Transaction

use of com.moez.QKSMS.mmssms.Transaction in project qksms by moezbhatti.

the class AirplaneModeReceiver method sendSms.

private void sendSms(Context context, MessageItem messageItem) {
    Transaction sendTransaction = new Transaction(context, SmsHelper.getSendSettings(context));
    Message message = new Message(messageItem.mBody, messageItem.mAddress);
    message.setType(Message.TYPE_SMSMMS);
    context.getContentResolver().delete(messageItem.mMessageUri, null, null);
    sendTransaction.sendNewMessage(message, 0);
}
Also used : Transaction(com.moez.QKSMS.mmssms.Transaction) Message(com.moez.QKSMS.mmssms.Message)

Aggregations

Transaction (com.moez.QKSMS.mmssms.Transaction)7 Message (com.moez.QKSMS.mmssms.Message)6 Bundle (android.os.Bundle)2 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 AnimationDrawable (android.graphics.drawable.AnimationDrawable)1 Drawable (android.graphics.drawable.Drawable)1 Uri (android.net.Uri)1 ConversationLegacy (com.moez.QKSMS.data.ConversationLegacy)1