From 193d1ded1138749bce02e909739c9fff517ab36f Mon Sep 17 00:00:00 2001 From: Jeff Chang Date: Tue, 4 May 2021 11:38:16 +0800 Subject: [PATCH] Adding singleInstancePerTask type activity in IntentPlayground Bug: 187124445 Test: build Change-Id: I684a9327267273efd7a19df0f0897e597c10543d --- samples/IntentPlayground/AndroidManifest.xml | 4 ++++ .../android/intentplayground/FlagUtils.java | 3 +++ .../SingleInstancePerTaskActivity.java | 22 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 samples/IntentPlayground/src/com/example/android/intentplayground/SingleInstancePerTaskActivity.java diff --git a/samples/IntentPlayground/AndroidManifest.xml b/samples/IntentPlayground/AndroidManifest.xml index aa934fa18..25e5d28e9 100644 --- a/samples/IntentPlayground/AndroidManifest.xml +++ b/samples/IntentPlayground/AndroidManifest.xml @@ -30,6 +30,10 @@ + diff --git a/samples/IntentPlayground/src/com/example/android/intentplayground/FlagUtils.java b/samples/IntentPlayground/src/com/example/android/intentplayground/FlagUtils.java index fdad2f624..662f24895 100644 --- a/samples/IntentPlayground/src/com/example/android/intentplayground/FlagUtils.java +++ b/samples/IntentPlayground/src/com/example/android/intentplayground/FlagUtils.java @@ -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"; diff --git a/samples/IntentPlayground/src/com/example/android/intentplayground/SingleInstancePerTaskActivity.java b/samples/IntentPlayground/src/com/example/android/intentplayground/SingleInstancePerTaskActivity.java new file mode 100644 index 000000000..a5db6d644 --- /dev/null +++ b/samples/IntentPlayground/src/com/example/android/intentplayground/SingleInstancePerTaskActivity.java @@ -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 {} \ No newline at end of file