0

我是 Android 新手,所以只研究示例来学习和玩东西。目前我正在研究一个通过定时器任务生成图像的示例,但我被困在一个点上,我真的需要专家的建议。下面是代码以及它在哪里使用 Log.i("MARKER", " * ** ")..... 有人可以告诉我为什么我在行的最后一部分出现错误吗????

    @Override
    public void run() {
        // TODO Auto-generated method stub
        Log.i(“MARKER”,”******************************************”);

        //int numViews = container.getChildCount(); 

        ImageView toAdd = new ImageView(ImagePlayActivity.this);        
        Drawable imgContent = ImagePlayActivity.this.getResources().getDrawable(R.drawable.icon);
        toAdd.setImageDrawable(imgContent);
        toAdd.setTag(“img”+counter++);

        Random rndGen = new Random();

      LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,rndGen.nextInt(300),rndGen.nextInt(300));
        toAdd.setLayoutParams(lp);
        toAdd.setBackgroundColor(Color.TRANSPARENT);

        AlphaAnimation anim = new AlphaAnimation(0, 1);
        anim.setDuration(1000);
        container.addView(toAdd);
        //container.invalidate(); 
        toAdd.startAnimation(anim);



    }
};

提前致谢。

4

1 回答 1

1
于 2012-09-14T14:09:07.610 回答