DragEvent.ACTION_DROP错误

时间:2014-01-10 12:53:07

标签: java android drag-and-drop

当我在Drop动作中调用delete方法时,应用程序会给出“app not responding”

case DragEvent.ACTION_DROP:
          View view = (View) event.getLocalState();
          ViewGroup owner = (ViewGroup) view.getParent();
          owner.removeView(view);
          FrameLayout container = (FrameLayout) v;
          container.addView(view);
          view.setVisibility(View.VISIBLE);
          app.runOnUiThread(new Runnable() {
                public void run() {
                    try{
                    DeleteWithID(id_db);    
                    }catch(Exception e){
                        e.printStackTrace();
                    }
                    }
              });
          break;

0 个答案:

没有答案