fork download
  1. private class OnItemLongClickListener implements AdapterView.OnItemLongClickListener {
  2.  
  3. public boolean onItemLongClick(AdapterView<?> parent, View view , int position, long id) {
  4. //ダイアログ準備
  5. AlertDialog.Builder builder = new AlertDialog.Builder(Tab_01.this);
  6. builder.setTitle("削除しますか?");
  7. builder.setPositiveButton("はい", new DialogInterface.OnClickListener() {
  8. @Override
  9. public void onClick(DialogInterface dialog, int which) {
  10. db.delete(DB1.TABLE_NAME, "id = " + id, null);
  11. }
  12. });
  13. builder.setNegativeButton("いいえ",null);
  14. builder.setCancelable(true);
  15. builder.show();
  16. return true;
  17. }
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: modifier private not allowed here
 private class OnItemLongClickListener implements AdapterView.OnItemLongClickListener {
         ^
Main.java:1: error: package AdapterView does not exist
 private class OnItemLongClickListener implements AdapterView.OnItemLongClickListener {
                                                             ^
Main.java:3: error: cannot find symbol
        public boolean onItemLongClick(AdapterView<?> parent, View view , int position, long id) {
                                       ^
  symbol:   class AdapterView
  location: class OnItemLongClickListener
Main.java:3: error: cannot find symbol
        public boolean onItemLongClick(AdapterView<?> parent, View view , int position, long id) {
                                                              ^
  symbol:   class View
  location: class OnItemLongClickListener
Main.java:5: error: package AlertDialog does not exist
            AlertDialog.Builder builder = new AlertDialog.Builder(Tab_01.this);
                       ^
Main.java:5: error: package AlertDialog does not exist
            AlertDialog.Builder builder = new AlertDialog.Builder(Tab_01.this);
                                                         ^
Main.java:5: error: cannot find symbol
            AlertDialog.Builder builder = new AlertDialog.Builder(Tab_01.this);
                                                                  ^
  symbol:   class Tab_01
  location: class OnItemLongClickListener
Main.java:7: error: package DialogInterface does not exist
            builder.setPositiveButton("??", new DialogInterface.OnClickListener() {
                                                               ^
Main.java:9: error: cannot find symbol
                public void onClick(DialogInterface dialog, int which) {
                                    ^
  symbol: class DialogInterface
Main.java:8: error: method does not override or implement a method from a supertype
                @Override
                ^
Main.java:10: error: cannot find symbol
                    db.delete(DB1.TABLE_NAME, "id = " + id, null);
                              ^
  symbol: variable DB1
Main.java:10: error: cannot find symbol
                    db.delete(DB1.TABLE_NAME, "id = " + id, null);
                    ^
  symbol: variable db
12 errors
stdout
Standard output is empty