为什么我的Android活动不刷新/重绘?

时间:2022-04-22 21:12:18

RoomInfoActivity.java: http://pastebin.com/L9fFsFeH (note: this is the 3rd activity launched by the same application, not that it should matter..)

RoomInfoActivity.java:http://pastebin.com/L9fFsFeH(注意:这是由同一个应用程序启动的第三个活动,而不是它应该重要..)

AndroidManifest.xml: http://pastebin.com/QbvQaTf3

room_info.xml: http://pastebin.com/DFNABSNF

Image: http://dl.dropbox.com/u/16952797/temp_stuff/elfapp_ss04.PNG (note: when I click on the button, "nothing" happens.)

图片:http://dl.dropbox.com/u/16952797/temp_stuff/elfapp_ss04.PNG(注意:当我点击按钮时,“没有”发生。)

Description: So what happens is the code compiles just fine, and the .apk is launched and run without any issues, but the RoomInfoActivity doesn't reflect the changes that are supposed to be made (such as changing the text of the TextViews and Button) when I click on the button. I'm looking for the least complicated way to do these.

描述:所以会发生什么,代码编译得很好,.apk启动并运行没有任何问题,但RoomInfoActivity不反映应该进行的更改(例如更改TextViews和Button的文本) )当我点击按钮时。我正在寻找最简单的方法来做这些。

EDIT: I have now made a change, I added this line buttonCleaned.setClickable(true); under this:

编辑:我现在做了一个更改,我添加了这行buttonCleaned.setClickable(true);根据这个:

rumInfo.setText(getIntent().getExtras().getString("entry"));
buttonCleaned.setText("Färdig med städningen");
rumStatus.setText("Status: "+checkStatus());

1 个解决方案

#1


0  

Is your onClick() method ever called? I think you need to set the Activity as a click listener on the button, using the setOnClickListener method.

您的onClick()方法是否曾被调用?我认为您需要使用setOnClickListener方法将Activity设置为按钮上的单击侦听器。

#1


0  

Is your onClick() method ever called? I think you need to set the Activity as a click listener on the button, using the setOnClickListener method.

您的onClick()方法是否曾被调用?我认为您需要使用setOnClickListener方法将Activity设置为按钮上的单击侦听器。