Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:39:50+00:00 2026-06-18T04:39:50+00:00

I have a GridView fill with images, when I click on one image, it

  • 0

I have a GridView fill with images, when I click on one image, it is displayed in full screen in a PagerActivity and for each images in full screen a piece of html is displayed at the bottom in a webview. On touch some webViews launch a video and some do nothing.

My problem is if I touch a “webView video”, the video is displayed in the next layout.

Example : I have 3 images in my Grid. I clicked on the first, this image is displayed in full screen with a webview at the bottom and when I clicked on the webview in order to launch the video on top of the image 1 the video is launched on top of the image 2.

Here a part of my code, ImagePagerActivity :

public class ImagePagerActivity extends BaseActivity {

...

private class ImagePagerAdapter extends PagerAdapter implements OnTouchListener,Handler.Callback {

    ...

    public Object instantiateItem(View view, final int position) {
        final View imageLayout = inflater.inflate(R.layout.item_pager_image, null);
        final ImageView imageView = (ImageView) imageLayout.findViewById(R.id.image);
        final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading);
        final WebView webView = (WebView) imageLayout.findViewById(R.id.webView1);
        final TextView textView=(TextView) imageLayout.findViewById(R.id.edit_message);
        topLevelLayout = (RelativeLayout) imageLayout.findViewById(R.id.top_layout);
        videoView = (VideoView) imageLayout.findViewById(R.id.videoView);
        topLevelLayout.setBackgroundColor(0x00000000);


        ((ViewPager) view).addView(imageLayout, 0);


        imageLoader.displayImage(images[position], imageView, options, new SimpleImageLoadingListener() {

            @Override
            public void onLoadingStarted() {
                ...
            }

            @Override
            public void onLoadingFailed(FailReason failReason) {
                ...
            }

            @Override
            public void onLoadingComplete(Bitmap loadedImage) {

                // HERE ADD THE WEBVIEW ON THE BOTTOM OF THE IMAGE

            }
        });

        return imageLayout;
    }


    public boolean onTouch(View v, MotionEvent event) {

        if(isWebViewLaunchViedo()){
            PlayVideo(positionVideo);
        }
    }

  }

I use this project for the GridActivity and PagerActivity Universal image loader

I understand the instantiateItem(..) method is called twice, so that’s why when I try to play a video the videoView is already affect to the new one. But I don’t know How can I fix this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:39:51+00:00Added an answer on June 18, 2026 at 4:39 am

    I finally create a new transparent activity and play the video in the new activity.

    Manifest :

    <activity
      android:name="com.ad.AdVideoActivity"
      android:theme="@style/Theme.Transparent"         <------
      android:label="@string/title_activity_ad_video" >
    </activity>
    

    New Ontouch :

    public boolean onTouch(View v, MotionEvent event) {
            if (ADS_VIDEO.contains(v.getId()) && event.getAction() == MotionEvent.ACTION_DOWN) {
                intentVideo = new Intent(getBaseContext(),AdVideoActivity.class);
                startActivity(intentVideo);
            }
    
            return false;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView and Edit link for each row. I can click on
I have a GridView what I fill through a LINQ expression. Something like this:
I have configured a GridView to fill data by an ObjectDataSource . This ObjectDataSource
I have used a gridview and linqdatasourse , the gridview will be fill by
I have a page using ASPxGridView and to fill the GridView I use a
I have two tables I am using to fill a gridview. The tables have
I have a GridView in android which I fill it with data retrieved from
I have a gridview that i want to fill with data from my linq
I have a GridView in my form and I want when I click on
I have a Gridview that displays a huge list of products. On Client click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.