Quote:
Originally Posted by sunrain
I am using the latest version of the sample code. Any reasons why?
|
It looks like a got a bit carried away with a couple of find-replace searches right before I uploaded the sample code. What's happened is I've used getApplicationContext() when I should be passing in the Activity's context.
What you need to do is fix these two lines, replacing
getApplicationContext() with
this, as shown below:
Code:
LayoutInflater li = LayoutInflater.from(getApplicationContext());
View quakeDetailsView = li.inflate(R.layout.quake_details, null);
AlertDialog.Builder quakeDialog = new AlertDialog.Builder(getApplicationContext());
Becomes:
Code:
LayoutInflater li = LayoutInflater.from(this);
View quakeDetailsView = li.inflate(R.layout.quake_details, null);
AlertDialog.Builder quakeDialog = new AlertDialog.Builder(this);
Sorry about that, I've got a few updates to the sample code pending that should be available in the next few days.