Question : Which is the correct explanation of ListView?
1. It is necessary to use ListView as a set with ListActivity.
2. You cannot use a ListView when there is no information to be displayed.
3. When displaying a list of Strings using an ArrayAdapter class in ListView, you must save the value in anArrayList.
4. ListView has a function to display a list of uniquely defined Views other than TextView.
Correct Answer : Get Lastest Questions and Answer : 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 following is incorrect about the Toast class?
4. A Toast is displayed for only one of the following periods: Toast.LENGHT_SHORT orToast.LENGTH_LONG
Correct Answer : Get Lastest Questions and Answer : Explanation: A toast is a view containing a quick little message for the user. The toast class helps you create and show those.
When the view is shown to the user, appears as a floating view over the application. It will never receive focus. The user will probably be in the middle of typing something else. The idea is to be as unobtrusive as possible, while still showing the user the information you want them to see. Two examples are the volume control, and the brief message saying that your settings have been saved.
The easiest way to use this class is to call one of the static methods that constructs everything you need and returns a new Toast object.
Correct Answer : Get Lastest Questions and Answer : Explanation: ontent providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data and provide it to applications through the single ContentResolver interface. A content provider is only required if you need to share data between multiple applications. For example, the contacts data is used by multiple applications and must be stored in a content provider. If you don't need to share data amongst multiple applications you can use a database directly via SQLiteDatabase.
When a request is made via a ContentResolver the system inspects the authority of the given URI and passes the request to the content provider registered with the authority. The content provider can interpret the rest of the URI however it wants. The UriMatcher class is helpful for parsing URIs. The primary methods that need to be implemented are:
onCreate() which is called to initialize the provider query(Uri, String[], String, String[], String) which returns data to the caller insert(Uri, ContentValues) which inserts new data into the content provider update(Uri, ContentValues, String, String[]) which updates existing data in the content provider delete(Uri, String, String[]) which deletes data from the content provider getType(Uri) which returns the MIME type of data in the content provider