how i can stop the restarting or recalling of on create() on screen orientation ,i want to stop the recreation of activity on screen orientation. thanks in advance please tell me any better solution its really creating a problem. like in my program i am selecting some picture but on screen orientation the image goes off so thats why i want to stop the recreation of activity on screen orientation.
enter code here
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mainwindow);
Toast.makeText(getApplicationContext(),"a", 1).show();
bitmap = (Bitmap)getLastNonConfigurationInstance();
//Toast.makeText(getApplicationContext(),"a1", 1).show();
if (savedInstanceState != null)
{
bitmap=BitmapFactory.decodeFile(mImageCaptureUri.getPath());
Toast.makeText(getApplicationContext(),"preview have value", 1).show();
preview.setVisibility(View.VISIBLE);
From_Folder.setVisibility(View.GONE);
From_Camera.setVisibility(View.GONE);
preview.setImageBitmap(bitmap);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…