> Thank you for your help. So, what is this book you speak of...?

_The Busy Coder's Guide to Android Development_. Version 0.9 is available
in PDF and Kindle form on the CommonsWare Web site. A more formal
announcement is forthcoming.

> I've
> modified my code according to your suggestions. I've also added a
> couple other tests to see if I get output. Curious thing is that the
> only time I see any output on the screen is when I load 'http://
> commonsware.com'.  None of the other attempts show anything on the
> screen.  No real errors, just nothing shows up, however
> commonsware.com does show.

I broke into the Google servers and hacked the WebKit code to only show
the CommonsWare site.

Note to Google: that's a joke. Honest.

>     public void onCreate(Bundle icicle) {
>         super.onCreate(icicle);
>         setContentView(R.layout.main);
>         try {
>               mainPage = (WebView) findViewById(R.id.webView);
>               mainPage.loadData(
>                   "<html><body>Hello World!</body></html>",
>                   "text/html", "utf-8");
>
>               Thread.sleep(60000);
>
>               mainPage.loadData(
>                       "<html><body><img src=\"file:///android_asset/
> Winter.jpg\"></body></html>",
>                       "text/html", "utf-8");
>
>               Thread.sleep(60000);
>
>               mainPage.loadData(
>               "<img src=\"file:///android_asset/Winter.jpg\">",
>             "image/jpeg", "utf-8");
>
>               Thread.sleep(60000);
>               mainPage.loadUrl("http://commonsware.com";);
>
>               Thread.sleep(60000);
>         } catch (Exception e) {
>               android.util.Log.e("Exception : ", e.getMessage());
>         }
>     }

That code works?

The reason I ask is that the Android docs mention that if your activity
doesn't return from callbacks like onCreate() quickly, Android will
consider the activity stuck or dead and will get rid of it. I hadn't
experimented with that feature in the emulator, but I had figured it was
already in there. I would think that minute-long sleep periods in
onCreate() ought to trigger the scavenger, but apparently not.

I seem to recall that accessing the Google Web site was hit or miss, but I
wrote that off as being something peculiar to them perhaps doing
browser-sniffing and causing Android's WebKit some problems. I can say
that http://commonsware.com uses nothing more complicated than CSS -- no
Javascript, no server-side smarts (until you get to the Warescription
ecommerce piece), etc.

Have you tried visiting these other sites in the built-in Browser
application? If they work there, but not in your activity, that might
trigger some ideas. But, beyond that, off the top of my head, I don't know
what might be going wrong.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ -- Available Now!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to