Android Open Source - sdl_tester_android Delete Command Dialog

From Project

Back to project page sdl_tester_android.


The source code is released under:

Copyright (c) 2014, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are m...

If you think the Android project sdl_tester_android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.livio.sdltester.dialogs;
//  w ww .j a  va  2 s.c o  m
import java.util.List;

import android.content.Context;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.livio.sdl.SdlRequestFactory;
import com.livio.sdl.dialogs.BaseAlertDialog;
import com.livio.sdl.enums.SdlCommand;
import com.livio.sdl.utils.AndroidUtils;
import com.livio.sdltester.R;
import com.smartdevicelink.proxy.RPCRequest;

public class DeleteCommandDialog extends BaseAlertDialog{

  private static final SdlCommand SYNC_COMMAND = SdlCommand.DELETE_COMMAND;
  private static final String DIALOG_TITLE = SYNC_COMMAND.toString();
  private ListView listView;
  public DeleteCommandDialog(Context context, List<MenuItem> commandList) {
    super(context, DIALOG_TITLE, R.layout.listview);
    listView.setAdapter(AndroidUtils.createListViewAdapter(context, commandList));

  protected void findViews(View parent) {
    listView = (ListView) parent.findViewById(;
    listView.setOnItemClickListener(new OnItemClickListener() {
      public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        final MenuItem selectedButton = ((ArrayAdapter<MenuItem>) parent.getAdapter()).getItem(position);
        final int commandId = selectedButton.getId();
        RPCRequest result = SdlRequestFactory.deleteCommand(commandId);


Java Source Code List