Is there any way to include a ViewPager in a listView to transition from one picture to another?

I'm currently making an application that is supposed to have a listView that contains a textView and under the textView it is supposed to have one imageView that contains many images, but that I can only see one image at a time. I want to be able to swipe on the imageView so that I can transition from one picture to another without having to leave the activity. Is there any way to include a ViewPager as seen in but have it inside the listView or something similar in order to accomplish this? In case it is helpful I have included my custom adapter that currently only supports the text and one image.

public class MyAdapter extends BaseAdapter {
    private Context mContext;
    private List<Bean> mList;
    private PopupWindow popUpWindow;
private LayoutInflater inflater;

    public MyAdapter(Context context,List<Bean> list){


public int getCount() {
    return mList.size();

public Object getItem(int position) {
    return mList.get(position);

public long getItemId(int position) {
    return position;

public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    //use convertView recycle
        holder=new ViewHolder();
        convertView = LayoutInflater.from(mContext).inflate(R.layout.content_orders, parent, false);
        holder.textView= (TextView) convertView.findViewById(;
        holder.imageView= (ImageView) convertView.findViewById(;
        holder.information= (Button) convertView.findViewById(;
        holder = (ViewHolder) convertView.getTag();

    //set text and url
    final View finalConvertView = convertView;
    holder.information.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            ViewGroup container = (ViewGroup) inflater.inflate(R.layout.information_popup, null);
            popUpWindow = new PopupWindow(container, 800,400,true);
            popUpWindow.showAtLocation(finalConvertView.findViewById(, Gravity.CENTER, 0,0);

            container.setOnTouchListener(new View.OnTouchListener() {
                public boolean onTouch(View view, MotionEvent motionEvent) {
                    return true;


    return convertView;

class ViewHolder{
    TextView textView;
    ImageView imageView;
    Button information;
    Button close;



I ended up not being able to figure out how to do this using the viewPager, but I found out how to do it using a horizontalScrollView. Here is the link to the question with the answer that I posted.

Adding a Horizontal Scroll View to a ListView

Need Your Help

JDBC connection to very busy SQL 2000: selectMethod=cursor vs selectMethod=direct?

jdbc sql-server-2000 cursor selectmethod

In the process of trying to help out an app dev team with performance issues on a SQL 2000 server (from a bunch of Java applications on separate app servers), I ran a SQL trace and discovered that ...

Clicking button does nothing

javascript php html xml

I'm trying to make a program that takes 5 words from a database randomly and inserts them into an array. The page initially loads as desired, but nothing happens after the button is clicked. None o...