【发布时间】:2011-11-14 20:21:58
【问题描述】:
我的主要活动创建了一个包含线程的新类。 我需要有一排图像,它们按顺序更改为“打开”图像,甚至更改可见性等。
public class myActivity extends Activity implements OnCheckedChangeListener {
private TheSounds sound;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//the sound engine
sound = new TheSounds(this);
以及其中包含线程的类
public class TheSounds {
public Thread t;
public TheSounds(final myActivity testActivity){
t = new Thread(){
public void run() {
while(true) {
//somevariable++;
所以想法是有一些变量来表示要更改的图像。 我遇到的问题是从此线程中获取对视图中任何内容的引用。 如果您需要,我可以提供更多信息 谢谢
【问题讨论】:
标签: android class view android-activity