Hi there,
I have an action from a button click that performs a lengthy web based fetch,
so I have implemented it as a Runnable that is called from a Handler in my
Activity class. However, in certain situations I need to be able to present
the user with an alert dialog, which from the docs seems to require a Context
object on it's constructor. This was not visible from the inner class, so I
created a new class that implements Runnable that I pass the context to in it's
constructor as follows:
import android.app.AlertDialog;
import android.content.Context;
public class ActivityRunnable implements Runnable {
public Context mContext;
public AlertDialog mAlert;
public ActivityRunnable(Context ctx) {
mContext = ctx;
}
@Override
public void run() {
// TODO Auto-generated method stub
}
}
However, in my code that instantiates this class, and implements run(), I try
and run the following code:
mAlert = AlertDialog.Builder(mContext).create();
However, I get an error from Eclipse saying that the method Builder(Context) is
undefined for the type AlertDialog - has anyone else encountered this problem,
or know of a better solution to my problem?
regards,
frak
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en