I'm fetching JSON feed using Volley, which contains Name, Rating and URL. I have textview on Android which will display Fetched Name, Rating and all. I have a Button but it's showing the URL directly because I set Text as Fetched URL.
Currently, I'm getting this:
I need to Set Text of Button as Register & If the Button is clicked it should open the URL Fetched from the JSON Feed.
Hereby I'm attaching the code
@Override
public void onBindViewHolder(CourseViewHolder holder, int position) {
Course course = courseList.get(position);
holder.textViewCoursename.setText(course.getCoursename());
holder.textViewcoursedescshort.setText(course.getCoursedescshort());
//holder.textViewcourseurl.setText(course.getCourseurl());
holder.textViewcourserating.setText(course.getCourserating());
Glide.with(mCtx)
.load(course.getCourseimg())
.into(holder.imageView);
Button button = (Button) button.findViewById(R.id.textViewcourseurl);
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
//Do stuff here
}
});
}