I was too experiencing this sticking Toast issue when calling finish()
in a LicenceChecker Callback
I fixed it by creating a toast message on the UI thread then posting
to the threads handler setting the toast text and showing it..
public class LicenseCheck extends Activity {
...
private Toast mToast;
...
public void onCreate(Bundle savedInstanceState) {
...
mToast = Toast.makeText(this, "", Toast.LENGTH_SHORT);
...
}
...
private void errorToast(final String string) {
mHandler.post(new Runnable() {
public void run() {
mToast.setText(string);
mToast.show();
}
});
}
...
private class MyLicenseCheckerCallback implements
LicenseCheckerCallback {
...
public void applicationError(ApplicationErrorCode errorCode) {
if (isFinishing()) {
return;
}
handleResponse();
toastError("Error: " + errorCode.name());
startActivity(new Intent(this, Main.class));
finish();
}
...
}
...
}
Hope this helps, It fixed it for me.
On Mar 2, 1:36 am, vnv <[email protected]> wrote:
> On Mar 1, 11:26 pm, Julius Spencer <[email protected]> wrote:
>
> > Hi,
>
> > No unfortunately that didn't work.
>
> Just for a try.... always put Log.d() or whatever...... if you see
> constantly repeating output message.... you have while(1) problem and
> it's easier to notice it.
--
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