Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public class SmsSentReceiver extends BroadcastReceiver
  2. {
  3.  
  4. @Override
  5. public void onReceive(Context context, Intent intent)
  6. {
  7. if (getResultCode() == Activity.RESULT_OK)
  8. Toast.makeText(context, R.string.sent, Toast.LENGTH_SHORT).show();
  9. else
  10. Toast.makeText(context, R.string.error_sending_sms, Toast.LENGTH_LONG).show();
  11. context.unregisterReceiver(this);
  12. }
  13.  
  14. }
  15.  
  16. public class SmsSentReceiver extends BroadcastReceiver
  17.  
  18. new Handler(Looper.getMainLooper()).post(new Runnable()
  19. {
  20. @Override
  21. public void run()
  22. {
  23. Toast.makeText(context, R.string.sent, Toast.LENGTH_SHORT).show();
  24. }
  25. });
  26.  
  27. new Handler(Looper.getMainLooper()).post(new Runnable()
  28. {
  29. @Override
  30. public void run()
  31. {
  32. Toast.makeText(context, R.string.sent, Toast.LENGTH_SHORT).show();
  33. }
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement