问题
I'm testing an Android app in x86_64 and x86 emulator and it crash (Android emulator closed unexpectedly) after select an item from a AlertDialog that shows a list. AlertDialog is called from onOptionsItemSelected overrided method in class that extends from AppCompatActivity.
Some code:
public class ListViewActivity extends AppCompatActivity {
private static final String TAG = "android-user-interface";
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(this, "Item de menu seleccionado", Toast.LENGTH_SHORT).show();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("titulo")
.setItems(new String[]{"uno", "dos", "tres"}, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//fails before this
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
//return super.onOptionsItemSelected(item);
return true;
}
//...
}
In crash windows I got
Operating system: Windows NT
10.0.10586
CPU: amd64
family 6 model 60 stepping 3
8 CPUs
Crash reason: EXCEPTION_ACCESS_VIOLATION_READ
Crash address: 0x18
Assertion: Unknown assertion type 0x00000000
Process uptime: not available
... more info
Some ideas / information about this issue?
来源:https://stackoverflow.com/questions/39893311/android-x86-64-and-x86-emulator-crash-on-alertdialog-onclick-event