私は 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);
}
};
前もって感謝します。