Question : Which of the following WebView methods allows you to manually load custom HTML markup?
1. loadData
2. loadHTML
3. loadCustomData
4. loadCustomHTML
Correct Answer : 1 Explanation: Loads the given data into this WebView using a 'data' scheme URL.
Note that JavaScript's same origin policy means that script running in a page loaded using this method will be unable to access content loaded using any scheme other than 'data', including 'http(s)'. To avoid this restriction, use loadDataWithBaseURL() with an appropriate base URL.
The encoding parameter specifies whether the data is base64 or URL encoded. If the data is base64 encoded, the value of the encoding parameter must be 'base64'. For all other values of the parameter, including null, it is assumed that the data uses ASCII encoding for octets inside the range of safe URL characters and use the standard %xx hex encoding of URLs for octets outside that range. For example, '#', '%', '\', '?' should be replaced by %23, %25, %27, %3f respectively.
The 'data' scheme URL formed by this method uses the default US-ASCII charset. If you need need to set a different charset, you should form a 'data' scheme URL which explicitly specifies a charset parameter in the mediatype portion of the URL and call loadUrl(String) instead. Note that the charset obtained from the mediatype portion of a data URL always overrides that specified in the HTML or XML document itself.
Parameters data a String of data in the given encoding mimeType the MIME type of the data, e.g. 'text/html' encoding the encoding of the data Use this Html_value in this way:
String html_value = "Lorem Ipsum
About us
Lorem Ipsum is simply dummy text .
Lorem Ipsum is simply dummy text
Lorem Ipsum is simply dummy text
"; this is used into webview then only it will work because your html tag was not properly closed:
Question : Which of the following is the base class of all UI components?
1. ListView
2. Layout
3. View
4. ViewGroup
Correct Answer : 3 Explanation: ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.
Question : Which of the following is true about object arrayAdapter declared in the code below?
1. It creates a TextView for each String in array items.
2. It creates Buttons for each String in array items.
3. It creates four views for listView.
4. It replaces the layout of the activity with three consecutive TextView items
Correct Answer : 1 Explanation: A concrete BaseAdapter that is backed by an array of arbitrary objects. By default this class expects that the provided resource id references a single TextView. If you want to use a more complex layout, use the constructors that also takes a field id. That field id should reference a TextView in the larger layout resource.
However the TextView is referenced, it will be filled with the toString() of each object in the array. You can add lists or arrays of custom objects. Override the toString() method of your objects to determine what text will be displayed for the item in the list.
To use something other than TextViews for the array display, for instance, ImageViews, or to have some of data besides toString() results fill the views, override getView(int, View, ViewGroup) to return the type of view you want.