ruben wrote:
> I'm looking for an easy way to convert HelloWorld code to code that
> displays a simple web browser.
>
> In other words, how can I pass from this code:
>
> public class HA extends Activity {
> /** Called when the activity is first created. */
> @Override
> public void onCreate(Bundle icicle) {
> super.onCreate(icicle);
> setContentView(R.layout.main);
> }
> }
>
> to simple code for browsing the web (with a button at the menu bar
> that calls a function):
If by "simple Web browser" you mean "a component that displays HTML",
use WebView. Just embed it in your layout, use loadData() or loadUrl()
to populate the browser pane, and you're done.
If by "simple Web browser" you mean something with navigation buttons,
an address bar, and all that, you have to build that yourself (using
WebView as the base), or craft an Intent and use startActivity() to use
the built-in browser (in which case it's not running in your activity
and you have no control over the menu).
There is no "menu bar" in Android. There is an options menu (see
onPrepareOptionsMenu() in Activity) and some widgets support a context
menu (opened via a long-tap on the screen).
--
Mark Murphy (a Commons Guy)
http://commonsware.com
Warescription: All titles, revisions, & ebook formats, just $35/year
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---