ImageView not retaining Image when Screen rotation occurs

后端 未结 5 1271
清酒与你
清酒与你 2021-01-04 18:01
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Parcelable;
import android.ut         


        
5条回答
  •  天命终不由人
    2021-01-04 18:22

    You can avoid recreating the activity by setting the orientation and screensize flag in your Manifest file

    android:configChanges="keyboard|orientation|screenSize"
    

    If needed you can implement onConfigurationChanged() which will be called when the orientation changes. More information is in http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange

提交回复
热议问题