Code example for LinkedList

0
import java.io.IOException; 
import java.util.LinkedList; 
 
public class MmsDownloader extends MmscProcessor { 
 
  private final LinkedList<DownloadItem> pendingMessages = new LinkedList<DownloadItem>();
  private final SendReceiveService.ToastHandler toastHandler;
 
  public MmsDownloader(Context context, SendReceiveService.ToastHandler toastHandler) {
    super(context);
    this.toastHandler = toastHandler;
  } 
 
  public void process(MasterSecret masterSecret, Intent intent) {
    if (intent.getAction().equals(SendReceiveService.DOWNLOAD_MMS_ACTION)) {
      boolean isCdma    = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA;
      DownloadItem item = new DownloadItem(masterSecret, !isCdma, false,
                                           intent.getLongExtra("message_id", -1),
                                           intent.getLongExtra("thread_id", -1),
                                           intent.getStringExtra("content_location"),
                                           intent.getByteArrayExtra("transaction_id"));