Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

Algonquin College CST 2335 Quiz 2: 1)Which function gets called first in the Android Lifecycle: onStart b

Business Jun 03, 2021

Algonquin College

CST 2335

Quiz 2:

1)Which function gets called first in the Android Lifecycle:

    1. onStart

b.         onCreate

c.         onResume

 

 

  1. Which function gets called last in the Android Lifecycle:
    1. onPause
    2. onStop

c.         onDestroy

 

  1. When is the bundle parameter for the onCreate(Bundle savedInstance) null?

a.         When the application is loaded for the first time

b.         When onSaveInstance was called previously

 

 

  1. If the bundle parameter for the onCreate(Bundle savedInstance) is not null, which function gets called automatically?

a.         onRestoreInstanceState(Bundle savedInstanceState)

b.         onSaveInstanceState(Bundle outState)

 

  1. What does the first parameter in getSharedPreferences("a_string", Context.MODE_PRIVATE)?
    1. The string to retrieve

b.         The file name

c.         The string to save

 

  1. When you call putString("string_one", "string_two"), which string that represents the value (not name)?
    1. "string_one"

b.         "string_two"

c.         Unknown

 

  1. Which function must you call to retrieve the saved string from the sharedPreferences call: putString("string_one", "string_two")

a.         getString("string_one", "string_three")

b.         getString("string_two", "string_three")

 

  1. Which function must you call to start an activity when you want to get data back?
    1. startActivity()
    2. startActivityForData()

c.         startActivityForResult()

 

  1. What function must you call to end an Activity?
    1. endActivity()

b.         finish()

c.         finishActivity()

 

  1. If you call setResult(Activity.RESULT_OK), what will be the value of the request code parameter in onActivityResult(int request, int result, Intent data)?
    1. RESULT_OK
    2. 5

c.         Unknown

 

  1. What is the proper format for creating a Toast message

a.         Toast.makeText(getApplicationContext(), "The message", Toast.LENGTH_SHORT);

  1. Toast.makeText("The message", getApplicationContext(), Toast.LENGTH_SHORT);
  2. Toast.makeText(Toast.LENGTH_SHORT, "The message", getApplicationContext());

 

  1. What design pattern is used when chaining many function calls for creating an AlertDialog: dialog.setMessage().setTitle().setPositiveButton().setNegativeButton().show();?

a.         The alert pattern

b.         The builder pattern

c.         The command pattern

 

  1. Which Log function should I call to show warning information?
  1. Log.d()
  2. Log.i()

c.         Log.w()

 

 

 

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment