Question: 1. Inside the XML snippet, below activity_main.xml, add two lines of XML so that the dimensions (width and height) of the TextView are just enough

1. Inside the XML snippet, below activity_main.xml, add two lines of XML so that the dimensions (width and height) of the TextView are just enough to hold the text inside the

TextView.

/>

2.Inside the onCreate method, fill in the code to set the layout and GUI defined in activity_main.xml.

public void onCreate( Bundle savedInstanceState )

{

// Your code goes here

}

3. Inside an activity element of the AndroidManifest.xml file, write the code so that this activity is supported only in vertical orientation.

android:name = ".MainActivity"

4. Inside activity_main.xml, we define a Button element; when the user clicks on the button, we want the method go (from the MainActivity class, whose content view is defined in activity_main.xml) to execute. Write the code for it.

5. Inside an Activity class, write a line of code to get a SharedPreferences reference.

6. Inside an Activity class, write a statement that creates and shows a Toast that lasts 5 seconds and says HI.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!