Android Open Source - sdl_tester_android Delete Submenu 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;
/*from w ww . j  a v a2s .co 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.BaseSingleListViewDialog;
import com.livio.sdl.enums.SdlCommand;
import com.livio.sdltester.R;
import com.smartdevicelink.proxy.RPCRequest;

public class DeleteSubmenuDialog extends BaseSingleListViewDialog<MenuItem>{

  private static final SdlCommand SYNC_COMMAND = SdlCommand.DELETE_SUB_MENU;
  private static final String DIALOG_TITLE = SYNC_COMMAND.toString();
  public DeleteSubmenuDialog(Context context, List<MenuItem> submenuList) {
    super(context, DIALOG_TITLE, submenuList);

  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 menuId = selectedButton.getId();
        RPCRequest request = SdlRequestFactory.deleteSubmenu(menuId);
        // since this isn't an ok/cancel dialog, we must dismiss the dialog when an item is selected


Java Source Code List