Which of the following lines of code is used to pass a value to the next activity?
A. Intent i = new Intent(this,newActivity);
B. addExtra("test");startActivity(i);
C. Intent i = new Intent(this,newActivity);
D. putValue("test");startActivity(i);
E. Intent i = new Intent(this,newActivity);
F. putValue("value1","test");startActivity(i);
G. Intent i = new Intent(this,newActivity);
H. putExtra("value1","test");startActivity(i);
Which configuration file holds the permission to use the internet?
A. Layout file
B. Property file
C. Java source file
D. Manifest file
Which of the following are primary pieces of information that are required to define in an implicit Intent?
A. An action to be performed and data to operate on.
B. An action to be performed and a category for additional information.
C. A Bundle for extra data.
D. A category of additional information and data to operate on.
Which of the following is true about object arrayAdapter declared in the code below?
String[] items = {"Item 1","Item 2","Item 3"};
ArrayAdapter
items);
listView.setAdapter(arrayAdapter);
A. It creates a TextView for each String in array items
B. It creates Buttons for each String in array items
C. It creates four views for listView
D. It replaces the layout of the activity with three consecutive TextView items
Consider the following AndroidManifest.xml file:
package="mycube.test" android:versionCode="1" android:versionName="1.0" > android:minSdkVersion="8" android:targetSdkVersion="17" /> android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Light.NoTitleBar" > android:screenOrientation="portrait" android:label="@string/app_name" >
What is the syntax error of this file?
A. The INTERNET permission must be removed.
B. Tag uses-sdk must have attribute android:maxSdkVersion set.
C. the package name must be "com.mycube.test".
D. The
Which of the following lines of code starts activity Activity2 from a current activity Activity1?
A. Intent intent = new Intent(this,new Activity2());startActivity(intent);
B. Intent intent = new Intent(new Activity2());startActivity(intent);
C. Intent intent = new Intent (Activity1.class,Activity2.class);startActivity(intent);
D. Intent intent = new Intent(this,Activity2.class);startActivity(intent);
Which of following is incorrect about the Toast class?
A. You cannot set a custom layout for a Toast.
B. You cannot set a custom layout for a Toast There is no need to close or hide a Toast, since it closes automatically.
C. There is no need to close or hide a Toast, since it closes automatically.
D. A Toast is displayed for only one of the following periods: Toast.LENGHT_SHORT or Toast.LENGTH_LONG.
The first image below includes an Android code to generate AlertDialog which is illustrated in the second image. The last line of the code includes "xxxxxxx". Which of the following choices is the correct line of code to replace "xxxxxxx" for the purpose of showing this AlertDialog?
A. SaveAlert.show( )
B. Save-Activity( )
C. Start.activity ( )
D. savealert.show( )
The code snippet below displays a menu which is illustrated in another image. The emulator image displays a menu that contains three items, but in the code file none of these menu items are available. Where do these items come from?
A. This file will not show any menu items.
B. As illustrated in the code, these items are already added in the resource the called menu.xml and this file exists m a container called menu.
C. These menu items are already added to AndroidManitfest,xml file.
D. These items are added in activity_main.xml file.
Which of the following files has the correct name for a layout design file of an activity in an Android app?
A. Gradle.sql
B. MainActivity,java or MainActivity.kt
C. Sample.class
D. ctivity_ main.xml