Bincy Baby Bincy Baby - 2 months ago 25
Android Question

Is there anyway to provide click listener to slider layout in daimajia AndroidImageSlider?

In my project there is an image slider done by daimajia AndroidImageSlider . When i click on image i want to open another activity/page. I have tried and inserted an linearlayout inside the sliderlayout. But click listener in this linearlayout makes sliderlayout stuck.

<com.daimajia.slider.library.SliderLayout
android:id="@+id/advertiseSlider"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:id="@+id/linearSlider"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.daimajia.slider.library.SliderLayout>

Answer

tried this way,

advertiseSlider.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        Intent intent = new Intent(this,Image.class);
        intent.putExtra("imageurls", imageurls);
        startActivity(intent);
    }
});
Comments