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 7072099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:46:03+00:00 2026-05-28T05:46:03+00:00

I am doing like these it is loading static these image? public class ArchiveGroup

  • 0

I am doing like these it is loading static these image?

public class ArchiveGroup extends Activity  {
    Button btn;
    ViewFlipper flip;
    public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.next);
                btn=(Button)findViewById(R.id.btn);
                flip=(ViewFlipper)findViewById(R.id.flip);

        }
            public void ClickHandler(View v)
            {
             flip.showNext();
            }
            public void ClickHandler1(View v)
            {
            Toast.makeText(this,"text",Toast.LENGTH_LONG).show();
            }
}

i am using three imageview in ViewFlipper in xml file

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
    <Button
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Flip"
    android:id="@+id/btn"
    android:onClick="ClickHandler"
    />
    <ViewFlipper
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:id="@+id/flip"
    >
    <ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher"
    />
     <ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher"
    />
    <ImageView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:src="@drawable/ic_launcher"
    />

    </ViewFlipper>
</LinearLayout>

How to set dynamic images to these imageView. By using single ImageView.

  • 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-05-28T05:46:04+00:00Added an answer on May 28, 2026 at 5:46 am

    In your xml just add only this,

    <ViewFlipper android:id="@+id/flipper" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    </ViewFlipper>
    

    need not enclose with any ImageViews.

    Now do this in your coding.

    Considering that you have stored your Images in a array like this,

    int gallery_grid_Images[]={R.drawable.gallery_image_1,R.drawable.gallery_image_2,R.drawable.gallery_image_3,
            R.drawable.gallery_image_4,R.drawable.gallery_image_5,R.drawable.gallery_image_6,R.drawable.gallery_image_7,
            R.drawable.gallery_image_8,R.drawable.gallery_image_9,R.drawable.gallery_image_10
            };
    

    Now in your onCreate(),

    viewFlipper = (ViewFlipper) findViewById(R.id.flipper);
     for(int i=0;i<gallery_grid_Images.length;i++)
            {
            //  This will create dynamic image view and add them to ViewFlipper
                setFlipperImage(gallery_grid_Images[i]);
            }
    

    And now add this method to your activity,

    private void setFlipperImage(int res) {
        Log.i("Set Filpper Called", res+"");
        ImageView image = new ImageView(getApplicationContext());
        image.setBackgroundResource(res);
        viewFlipper.addView(image);
    }
    

    That’s it. And now using your viewFlipper.showNext(); and viewFlipper.showPrevious();
    methods you can show your dynamic images.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems like more and more OS X apps these days are doing all
I have a domain model that includes something like this: public class Customer :
is there a performance difference between doing something like: void function() { char bufgfer[256];
I would like to know if there are any templates for doing this in
I'm doing an MonoTouch application and I would like to apply a theme. (So
I'd like to learn assembler. However, there are very few resources for doing assembler
Rather than doing my_var = my_var+'extra string'; is there a shorthand method like .=
when doing like this: const int a = 5; I wonder if a will
I'm doing like a Mcdonalds' control panel to choose what clients want to take.
i am using ASIHTTPRequest in my iOS APP. i am doing like this :

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.