我想对设置菜单进行设置,返回时不显示任何 activity
I want to make an intent to the settings menu, without showing any activity while coming back
代码正在运行,并在应用程序打开时打开数据漫游设置,但是当我点击后退按钮时,它显示一个空的 activity,我不希望它显示。我希望当我点击那个后退按钮时,我应该回到上一个任务。
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
}
使用
触发意图后立即完成activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
finish(); // Will destroy the activity and remove from stack
}
代码正在运行,并在应用程序打开时打开数据漫游设置,但是当我点击后退按钮时,它显示一个空的 activity,我不希望它显示。我希望当我点击那个后退按钮时,我应该回到上一个任务。
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
}
使用
触发意图后立即完成activityprotected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);
finish(); // Will destroy the activity and remove from stack
}