wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Android 2

Total questions: 7

Worksheet time: 4mins

Name
Class
Date
1.

Q1) The activity life cycle does not contain.................

a)

onStart()

b)

onCreat()

c)

onAttach()

d)

onPause()

2.

Q2) If you need to pass data back from an activity, Which method you should use?

a)

startActivity()

b)

startActivityForResult()

c)

ActivityForResult()

d)

None of the above.

3.

Q3) If you want to navigate from one activity to another then android provides you which class?

a)

Object

b)

startActivity

c)

Intent

d)

None of the above.

4.

Q4) The types of intents in android is\are

a)

A) Explicit intents

b)

B) Implicit intents

c)

C) Start intents

d)

D) Option A and B are correct.

5.

Q5) Suppose that there are two activities in an application named FirstActivity and SecondActivity. You want to send website name from ActivityOne to ActivityTwo. What code you will write? Suppose that website name is “CareerRide.com”

a)

Intent intent=new Intent (this, SecondActivity.class);

intent.putExtra("name", “CareerRide.com”);

startActivity(intent);

b)

Intent intent=new Intent (this, SecondActivity.class);

intent.putExtra( “CareerRide.com”);

startActivity(intent);

c)

Intent intent=new Intent ();

intent.putExtra("name", “CareerRide.com”);

startActivity(intent);

d)

None of the above.

6.

Q6) How will you get the data in secondActivity? Refer question Q5

a)

Intent intent=new Intent;

String str= intent.getStringExtra("name");

Toast.makeText(this, str , Toast.LENGTH_LONG).show();

b)

Intent intent=getIntent();

String str= intent.getStringExtra("name");

Toast.makeText(this, str , Toast.LENGTH_LONG).show();

c)

Intent intent=getIntent();

String str= intent.getText("name");

Toast.makeText(this, str , Toast.LENGTH_LONG).show();

d)

None of the above

7.

...........محلها intent ال

a)

العين

b)

الاذن

c)

القلب

d)

الرجل