I have an Activity that uses a ListView to simply display a list of options for a user to select and when they select an option they are taken to a new Activity.
However on occasion the Activity with the options freezes when I try to select one of the options, I get the ANR and in the log cat t开发者_运维知识库he following error is displayed:
java.lang.RuntimeException: Performing pause of activity that is not resumed:<Activity>
Does anyone know what this error means and how to diagnose it?
A search brings up very little.
Does anyone know what may be causing the error?
I can post the code on request
Code as requested:
lvMenu.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
switch(position){
case 0:
Intent intent = new Intent(this, SettingsApp.class);
startActivity(intent);
break;
case 1:
Intent intentHO = new Intent(.this, SettingsHO.class);
startActivity(intentHO);
break;
case 2:
Intent intentWifi = new Intent(this, Settings.class);
startActivity(intentWifi);
break;
case 3:
Intent intentAudio = new Intent(this, SettingsAudio.class);
startActivity(intentAudio);
break;
case 4:
Intent intentDiagnostics = new Intent(this, PhoneStatus.class);
startActivity(intentDiagnostics);
}
}
});
Seem you're doing something wrong starting a new Activity. Please post your onClickListener method.
精彩评论