'How to click imageSlider to go another activity?
I used com.denz.coskun.imageslider.models
I have to click the images in this image slider and wants open another activity, what I do, anyone helps me
imageSlider = view.findViewById(R.id.imageSlider);
//now we will create a list of images for image slide
ArrayList<SlideModel> slideModels = new ArrayList<>();
//now we fetch url from firestore
mStore.collection("Advertisment").get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()){
for (QueryDocumentSnapshot queryDocumentSnapshot :task.getResult()){
slideModels.add(new SlideModel(queryDocumentSnapshot.getString("url"), ScaleTypes.FIT));
imageSlider.setImageList(slideModels, ScaleTypes.FIT);
}
}else {
Log.w("TAG", "Error getting documents.", task.getException());
}
}
});
Solution 1:[1]
You can read github README.md
imageSlider.setItemClickListener(new ItemClickListener() {
@Override
public void onItemSelected(int position) {
Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
myIntent.putExtra("key", value); //Optional parameters
CurrentActivity.this.startActivity(myIntent);
}
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | A Sarshar |
