7

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.

caw
  • 30,999
  • 61
  • 181
  • 291
  • possible duplicate of [android failure getting some entry](http://stackoverflow.com/questions/17755967/android-failure-getting-some-entry) – Violet Giraffe Jan 14 '14 at 09:03
  • 2
    @VioletGiraffe: There's only one answer there, which is definitely not the solution to my problem. And there's another "related question" linked, but neither that question's solution is helpful. – caw Jan 14 '14 at 09:10
  • It was a solution to me for exactly the same line in logcat. – Violet Giraffe Jan 14 '14 at 09:36

1 Answers1

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.

Mr. P
  • 1,387
  • 1
  • 11
  • 25
  • 2
    This does not change anything. The expression that you proposed does already evaluate to `true`, and `runOnUiThread(...)` does not have any effect, therefore. By the way, if calling from the wrong thread been the cause for the problem, you would have seen `java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()` before ;) Thanks, anyway! – caw Jan 23 '14 at 04:31