Write a line of code that uses an instance of a GridView control named grLayout
ID: 3761452 • Letter: W
Question
Write a line of code that uses an instance of a GridView control named grLayout in a new ImageAdapter class using setAdapter().
Write a line of code that creates a reference array named Games for the images named callofduty, candycrush, halo, and sonicdash
Write a line of code that determines the length of the Games array from question 7 and assigns the value to an int variable named numberOfGames.
Write a line of code that assigns dentalLength to the length of a string named dental.
Write a custom toast message that resides within an onItemClick( ) method and states You have selected picture 4 of the political photos when arg2 is 4.
Write a line of code starting with addItem to display the first list item named Reservations.
Write a line of code starting with addItem to display the second list item named View Site connecting to the site android.com.
What do the numbers in the following statement represent? pic.setLayoutParams(new GridView.LayoutParams(300,325));
In the following method, what does int (integer) represent? public int getCount( ) { return Soccer.length; }
What would be returned in the method in question 17 if the Soccer array has the maximum index of 22?
What term does the following define? Constructs the values of data members of the class.
Write a statement that sets the scale type to CENTER for an ImageView instance named tower
Which XML file in the chapter project was switched from a TextView widget to a WebView widget?
Give four examples of Android device permissions mentioned in this chapter.
Write an If structure to compare if mItem is equal to 6. The value 6 has been assigned to an Integer value.
Write an If structure to compare if mItem is equal to 6. The value 6 has been assigned to a String value.
Which template XML layout file displays the item list fragment and the item detail container for a tablet?
Write a line of code starting with addItem to display the first list item named Reservations.
Write a line of code starting with addItem to display the second list item named View Site connecting to the site android.com.
In which file would the lines in questions 7 and 8 be written?
When a smartphone is detected, the app uses which XML layout to display the FrameLayout instance?
Explanation / Answer
a) GridView grLayout = (GridView) findViewById(R.id.grid_view);
// Instance of ImageAdapter Class
grLayout .setAdapter(new ImageAdapter(this));
b) Games[] CallofDuty=new Games[];
Games[] candycrush=new Games[];
Games[] halo=new Games[];
Games[] sonicdash=new Games[];
c) int numberOfGames;
numberOfGames=Games.Length
d) String[] dental = new String[dentalLength];
e) if(arg2==4)
//For arg2==4 below program will make below toast
Toast.makeText(getApplicationContext(), "You have selected picture 4 of the political photos", Toast.LENGTH_LONG).show();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.