@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.add_picture).setOnClickListener(this); imageLayout = (DraggableImageLayout) findViewById(R.id.image_layout); imageLayout.setHoverView((ImageView) findViewById(R.id.hover_view)); imageLayout.setScrollView((ScrollView) findViewById(R.id.scroll_view)); imageLayout.setAddPictureView(findViewById(R.id.add_picture)); }