---
title: "如何在做转屏的时候不销毁当前Activity"
author: "jonson"
date: "2014-10-23T14:00:35Z"
tags: []
categories: ["移动开发"]
slug: "activity"
draft: false
lastmod: "2014-10-23T14:39:54Z"
id: 2147062
url: "https://jonson.iteye.com/blog/2147062"
---

For **API 12 and below**: add

```
android:configChanges="orientation"
```

 

Add "screenSize" if you are targeting **API 13 or above** because whenever your orientation changes so does your screen size, otherwise new devices will continue to destroy your activity. 

```
android:configChanges="orientation|screenSize"
```

 

to your Activity in AndroidManifest.xml. This way your Activity wont be restarted automatically.