Possible Duplicate:
Activity has leaked window that was originally added
My browser crashes when I try to download an APK file. I have tried to do this in two different ways:
Calling:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://myUrl/myFile.apk")); startActivity(intent);
Letting the user click on a link in an
alertDialog
like:String myUrl = "http://myUrl/myFile.apk"; final AlertDialog d = new AlertDialog.Builder(context) .setPositiveButton("Dismiss", listener) .setCancelable(false) .setIcon(iconId) .setTitle(title) .setMessage(Html.fromHtml("<a href=\"" + myUrl + "\">MyLink</a>")) .create(); d.show();
Either way, the browser starts and shows a dialog, something about saving to an SD card, and then the dialog disappears and nothing more happens. I don't have an SD card (if I instead mount an SD card, I don't have a problem) but I need this to work without crashing if the user does not have an SD card.
In Logcat I can see:
Activity com.android.browser.BrowserActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@2bff4f40 that was originally added here
What can I do about this?