Android - Start Intent

2019-09-06 14:08发布

问题:

When searching for how to launch Intents some people have listed like below.

Can you launch an Intent with the following lines? How would you do it?

Display Settings

#Intent;component=com.android.settings/.DisplaySettings;end

Sound Settings

#Intent;component=com.android.settings/.SoundSettings;end

Wireless Settings

#Intent;component=com.android.settings/.WirelessSettings;end

Dialer

#Intent;component=com.android.contacts/.DialtactsActivity;end

回答1:

For the first line, it will be

Intent i = new Intent();
i.setClassName("com.android.settings", "com.android.settings.DisplaySettings");
startActivity(i);

The rest of them will be similar to this.