Fragment に DragListener を実装しようとしましたが、アプリがクラッシュし、次の行で NoClassDefFoundError が返されました。
findViewById(R.id.my_tab_fragment).setOnDragListener(new MyDragListener());
これは私のスニペットです:
public class MainFragmentActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle bundle) {
WWHApplication.getInstance().getJsonDBInstance();
WWHApplication.checkDB();
super.onCreate(bundle);
setContentView(R.layout.main_fragment_activity_drag);
findViewById(R.id.my_tab_fragment).setOnDragListener(new MyDragListener());
}
class MyDragListener implements OnDragListener {
//Drawable enterShape = getResources().getDrawable(
// R.drawable.shape_droptarget);
//Drawable normalShape = getResources().getDrawable(R.drawable.shape);
@Override
public boolean onDrag(View v, DragEvent event) {
switch (event.getAction()) {
case DragEvent.ACTION_DRAG_STARTED:
// Do nothing
break;
case DragEvent.ACTION_DRAG_ENTERED:
//v.setBackgroundDrawable(enterShape);
break;
case DragEvent.ACTION_DRAG_EXITED:
//v.setBackgroundDrawable(normalShape);
break;
case DragEvent.ACTION_DROP:
// Dropped, reassign View to ViewGroup
//View view = (View) event.getLocalState();
//ViewGroup owner = (ViewGroup) view.getParent();
//owner.removeView(view);
//LinearLayout container = (LinearLayout) v;
//container.addView(view);
//view.setVisibility(View.VISIBLE);
break;
case DragEvent.ACTION_DRAG_ENDED:
//v.setBackgroundDrawable(normalShape);
default:
break;
}
return true;
}
}
}
エラーを修正するにはどうすればよいですか? ありがとう