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);
}
Up to
API 13
there was a new value to theconfigChanges
attribute,screenSize
So if you're using large screens make sure to add screenSize in your configChanges attribute: