问题
In one Activity
(it's a SherlockActivity
, by the way) of my Android application, I have a normal ListView
.
For that ListView
, I set an AdapterView.OnItemClickListener
via getListView().setOnItemClickListener(...)
.
And in that listener, an AlertDialog
is built using the AlertDialog.Builder
class and then it is shown to the user:
getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, final View v, int position, long id) {
AlertDialog.Builder builder = new AlertDialog.Builder(MyActivity.this);
...
builder.setMessage(Html.fromHtml(...));
builder.show();
}
}
Now exactly when builder.show()
is called, the following warning does always appear in LogCat:
W/ResourceType(463): Failure getting entry for 0x010802c9 (t=7 e=713) in package 0 (error -75)
Where does this come from? To me, it seems this is out of my control, as it appears with builder.show()
, so that this warning is maybe generated somewhere in the sources for the AlertDialog
class. Is this true?
If not, how can I find which resource is missing? How to debug this warning?
Edit: There's no corresponding entry for 0x010802c9
(or whichever value that is at run time) in R.java
, so I really don't know how to debug this.
回答1:
Are you trying to open it from worker thread instead of GUI thread? You can check if the thread is GUI thread with:
Looper.myLooper() == Looper.getMainLooper()
In order to be sure that it is opened from GUI thread, use handler or runOnUiThread method.
来源:https://stackoverflow.com/questions/21105606/w-resourcetype463-failure-getting-entry-in-package-0-error-75-in-android-a