40611

Multiple web views on single screen/activity in android

Question:

Can one have more than one web view on a single screen/activity in an android app? Im new to android dev, and Im thinking of building an app where for instance the top quarter of the screen uses a webview which loads html,css, and js from local files packaged with the app (this will be the logo and menu items), and another scrollable web view occupies the bottom 3/4 of the screen with data retrieved from the internet. Similar to how the Twitter for Android app seems to work. Im not sure whether that app uses multiple web views though.

Thanks!

Answer1:

Not quite sure I understood why you want to have multiple WebView's but, yes, you can have several in the same Layout.

Answer2:

Yes, you could do that..the best way may be, using XML layout

<ol><li>

Add 2 weviews within a linear layout using android:layout_weight="1" So you get 2 webviews occupying half space each. You can give it accordingly.

</li> <li>

Now, use findViewById() in the program and get the ID of the webviews.

</li> </ol>

So you get both views in a single activity. Let me know if you have any other doubts.

Cheers

Nithin

Recommend

  • A few memory management questions involving class destructors and delete operator?
  • Why function parameter occupy at least 4 bytes stack on x86?
  • In Android, using java: determine string length of mix-bytes character String?
  • How to fade bottom edge of a scrollable TextView?
  • how to execute sql server stored procedure on php?
  • Bootstrap ScrollSpy skips section when no more scrollable area
  • Phonegap Android App, open links within app?
  • Prevent body from scrolling on mouswheel, but not the texarea
  • input type=“file” accept=“image/*” doesn't work in phone gap?
  • Why is OpenID Connect considered mobile friendly compared to SAML
  • setContentView() is not enough to switch between layouts?
  • You tube videos are not playing
  • Problem with Django using Apache2 (mod_wsgi), Occassionally is “unable to import from module” for no
  • ListItem.Attributes.Add not working
  • Adjust width of select element according to selected option's width
  • Loading .coffee files via a view in Rails
  • ADO and msqli connections very slow
  • PHP buffered output depending on server setting?
  • Android fill_parent issue
  • Uncaught Error: Could not find module `ember-load-initializers`
  • req.body is undefined - nodejs
  • Controls, properties, events and timers running in design time
  • Modifying destination and filename of gulp-svg-sprite
  • Importing jscolor library in angular 2
  • SVN: Merging two branches together
  • php design question - will a Helper help here?
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • How do I rollback to a specific git commit
  • Is there a mandatory requirement to switch app.yaml?
  • How to get icons for entities from eclipse?
  • Proper way to use connect-multiparty with express.js?
  • Load html files in TinyMce
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • Change div Background jquery
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • JaxB to read class hierarchy
  • Busy indicator not showing up in wpf window [duplicate]
  • costura.fody for a dll that references another dll
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize
  • How do I use LINQ to get all the Items that have a particular SubItem?