0

エラーリンク 私は初心者です。ここに画像を添付できませんでした。上記のエラーリンクを添付しました。ページャー xml を作成し、ビュー ページャー ID を定義しました。そして、アイテムページャーと呼ばれる別の xml を作成し、画像と進行状況 ID を定義しました。

public void onCreate(Bundle paramBundle)

{

   super.onCreate(paramBundle);


   Bundle localBundle = getIntent().getExtras();

   setContentView(R.layout.pager);
   String[] arrayOfString = localBundle.getStringArray("com.example.image.IMAGES");
   int i = localBundle.getInt("com.example.image.IMAGE_POSITION", 0);
   if (paramBundle != null)
   i = paramBundle.getInt("STATE_POSITION");
   this.options = new displayImageOptions.Builder().showImageForEmptyUri(R.drawable.ic_launcher).showImageOnFail(Rdrawable.ic_launcher).resetViewBeforeLoading(true).cacheOnDisc(true).imageScaleType(ImageScaleType.NONE).bitmapConfig(Bitmap.Config.RGB_565).displayer(new FadeInBitmapDisplayer(300)).build();

   this.pager = ((ViewPager)findViewById(R.id.myfivepanelpager));

   this.pager.setAdapter(new ImagePagerAdapter(arrayOfString));

   this.pager.setCurrentItem(i);

 }



  public void onSaveInstanceState(Bundle paramBundle)
  {
       paramBundle.putInt("STATE_POSITION", this.pager.getCurrentItem());
  }

  private class ImagePagerAdapter extends PagerAdapter
  {
       private String[] images;

       private LayoutInflater inflater;

       ImagePagerAdapter(String[] arg2)
       {
           Object localObject = null;
           this.images = (String[]) localObject;
           this.inflater = ImagePagerActivity.this.getLayoutInflater();;
       }

       public void destroyItem(View paramView, int paramInt, Object paramObject)
       {
           ((ViewPager)paramView).removeView((View)paramObject);
       }

       public void finishUpdate(View paramView)
       {
       }

       public int getCount()
       {
           return this.images.length;
       }

       public Object instantiateItem(View paramView, int paramInt)
       {
            FrameLayout localView = (FrameLayout)this.inflater.inflate(R.layout.item_pager, null);
            ImageView localImageView = (ImageView)localView.findViewById(R.id.imageView1);
            final ProgressBar localProgressBar = (ProgressBar)localView.findViewById(R.id.progressBar1);
            ImagePagerActivity.this.imageLoader.displayImage(this.images[paramInt], localImageView, ImagePagerActivity.this.options, new SimpleImageLoadingListener()
            {
                public void onLoadingComplete(String paramAnonymousString, View paramAnonymousView, Bitmap paramAnonymousBitmap)
                {
                    localProgressBar.setVisibility(8);
                }

                public void onLoadingStarted(String paramAnonymousString, View paramAnonymousView)
                {
                    localProgressBar.setVisibility(0);
                }
            });
            ((ViewPager)paramView).addView(localView, 0);
            return localView;
        }

        public boolean isViewFromObject(View paramView, Object paramObject)
        {
            return paramView.equals(paramObject);
        }

        public void restoreState(Parcelable paramParcelable, ClassLoader paramClassLoader)
        {
        }

        public Parcelable saveState()
        {
            return null;
        }

        public void startUpdate(View paramView)
        {       
        }
}
4

1 に答える 1