Merge "Adding singleInstancePerTask type activity in IntentPlayground" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-05-04 05:43:55 +00:00
committed by Android (Google) Code Review
3 changed files with 29 additions and 0 deletions

View File

@@ -30,6 +30,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SingleInstancePerTaskActivity"
android:launchMode="singleInstancePerTask"
/>
<activity
android:name=".SingleTopActivity"
android:launchMode="singleTop" />

View File

@@ -288,6 +288,9 @@ class FlagUtils {
case ActivityInfo.LAUNCH_SINGLE_TOP:
lm += "singleTop";
break;
case ActivityInfo.LAUNCH_SINGLE_INSTANCE_PER_TASK:
lm += "singleInstancePerTask";
break;
case ActivityInfo.LAUNCH_MULTIPLE:
default:
lm += "standard";

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.intentplayground;
/**
* An activity with launchMode="singleInstancePerTask" set in AndroidManifest.xml.
*/
public class SingleInstancePerTaskActivity extends BaseActivity {}