Reputation: 498
nothing seems to be wrong,no any error infomation,but changes in code no longer takes effect even for the simplest example.i.e:
public void onRadioButtonClicked(View view) {
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
switch(view.getId()) {
case R.id.rdo_todo:
if (checked){
Log.e("actedit", "rdo click22");
}
break;
case R.id.rdo_reminder:
if (checked){
TimePickerDialog_doofin.newInstance(0, 10, true)
.show(getFragmentManager(), "tpddf");
}
break;
}
}
add some logger:
public void onRadioButtonClicked(View view) {
// Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
Log.e("actedit", "rdo click???");
switch(view.getId()) {
case R.id.rdo_todo:
if (checked){
Log.e("actedit", "rdo click22");
}
break;
case R.id.rdo_reminder:
if (checked){
TimePickerDialog_doofin.newInstance(0, 10, true)
.show(getFragmentManager(), "tpddf");
Log.e("actedit", "rdo click rm");
}
break;
}
}
when i click the radio buttons,the logger does not show.Other changes in code also didn't take effect in devices.
I view the source file in disk,it did changed.delete apk from device and reinstall apk in debug mode ,the problem remains. clean project delete . at project's bin folder delete .metadate file and re-import project,still no use!!
there must be some place for eclipse to hide/store the old code,but where is it?? from this link: Java Code not properly updating
If none of these work, then I believe there could be some kind of lock in the file system but i have reboot several times,and use vim to see that the source code actually changes
i use android sdk with eclipse juno.
there were 3 versions of android sdks in computer before:4.2.2,4.4.2,4.4w,i mainly use 4.4.2. yesterday i deleted 4.4.2 sdk and start using 4.4w sdk ,the problem occurs after that.
i start a new project,the code is behaves normally,no prob. so i copy old project's bin and src folder to the new one,hope the problem can be solved,but it remains...
Upvotes: 1
Views: 354
Reputation: 13235
Do you have Ant/Maven/Gradle build for your project? If yes, then
Upvotes: 0
Reputation: 13235
Is your function onRadioButtonClicked
invoked at all?
You may confirm that by debuging.
If you have breakpoint inside onRadioButtonClicked
, click radio button and debuger is not stopping- have you assigned onRadioButtonClicked function to your radio (in layout xml file, or in code)?
There are two optons to add listener
android:onClick="onRadioButtonClicked"
in your RadioButton
tag.
<RadioButton android:id="@+id/radio_pirates"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pirates"
android:onClick="onRadioButtonClicked"/>
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.yourRadioGroup);
radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
public void onCheckedChanged(RadioGroup group, int checkedId) {
// checkedId is the RadioButton selected
}
});
Upvotes: 0
Reputation: 983
Have you tried a refresh on the entire project, and after that, make a clean.
In eclipse: Project -> Clean -> Clean all projects.
Then, run your app again.
Upvotes: 1