125806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount/* 225806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * Copyright (C) 2017 The Android Open Source Project 325806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * 425806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * Licensed under the Apache License, Version 2.0 (the "License"); 525806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * you may not use this file except in compliance with the License. 625806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * You may obtain a copy of the License at 725806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * 825806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * http://www.apache.org/licenses/LICENSE-2.0 925806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * 1025806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * Unless required by applicable law or agreed to in writing, software 1125806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * distributed under the License is distributed on an "AS IS" BASIS, 1225806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1325806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * See the License for the specific language governing permissions and 1425806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount * limitations under the License. 1525806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount */ 1625806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount 1725806414c27ad7a9b194e01328b1315058d3d2adGeorge Mountpackage android.support.v4.app.test; 1825806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount 1925806414c27ad7a9b194e01328b1315058d3d2adGeorge Mountimport android.support.v4.app.Fragment; 2025806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount 21f9039ecb78c9347ebf85c932d6613c807dbf460cGeorge Mountpublic class NonConfigOnStopActivity extends RecreatedActivity { 2225806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount @Override 2325806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount protected void onStop() { 2425806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount super.onStop(); 2525806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount 2625806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount getSupportFragmentManager() 2725806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount .beginTransaction() 2825806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount .add(new RetainedFragment(), "1") 2925806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount .commitNowAllowingStateLoss(); 3025806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount } 3125806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount 3225806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount public static class RetainedFragment extends Fragment { 3325806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount public RetainedFragment() { 3425806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount setRetainInstance(true); 3525806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount } 3625806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount } 3725806414c27ad7a9b194e01328b1315058d3d2adGeorge Mount} 38