Signup/Sign In

Basics of Android Intent

This Test will cover concepts of Intent in Android and its related features and functions.
Q. Intents __________.
Q. If you want to navigate from one activity to another then android provides you which class or method?
Q. In an implicit Intent, the sender specifies the type of receiver. True or False?

Q. Suppose that there are two activities in an application named ActivityOne and ActivityTwo. You want to invoke ActivityTwo from ActivityOne. What code will you write to do so?
Intent intent = new Intent (this, ActivityTwo.class);
startActivity(intent);
startActivity(new Intent(this, ActivityTwo.java));
Q. Which component is not activated by an Intent?
Q. Types of Intents in Android is\are:
Q. Suppose that there are two activities in an application named FirstActivity and SecondActivity. You want to send a website's name from first to second activity. What code will you write? Suppose that website name is "www.studytonight.com"
Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra("name", "www.studytonight.com");
startActivity(intent);
Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra("www.studytonight.com");
startActivity(intent);
Intent intent = new Intent();
intent.putExtra("name", "www.studytonight.com");
startActivity(intent);

Q. In the above you sent the data from first to the second activity. How will you GET the data in the second activity?
Intent intent = new Intent;
String str = intent.getStringExtra("name");
Intent intent = getIntent();
String st r= intent.getStringExtra("name");
Intent intent = new getIntent();
String str = intent.getText("name");
Q. You can shut down an Activity by calling its __________ method.
Q. When an activity is not in focus, but still visible on the screen it is in?

Related Tests: