---
title: "How to get boolean from savedInstancestate on orientatioin change"  
description: "How to get boolean from savedInstancestate on orientatioin change"  
author: "Anonymous User"  
published: 2015-02-03  
updated: 2015-02-03  
canonical: https://www.mindstick.com/forum/12934/how-to-get-boolean-from-savedinstancestate-on-orientatioin-change  
category: "mobile development"  
tags: ["android", "android activity"]  
reading_time: 1 minute  

---

# How to get boolean from savedInstancestate on orientatioin change

I want to save some [boolean](https://www.mindstick.com/forum/160332/how-does-the-boolean-function-work) [variables](https://www.mindstick.com/articles/715/php-variables) in [Bundle](https://www.mindstick.com/interview/2401/what-is-app-bundle) [i.e](https://answers.mindstick.com/qa/39877/what-state-was-the-first-to-enter-the-union-i-e-was-the-first-to-ratify-the-united-states-constitution) savedInstaceState those i can use after [orientation](https://www.mindstick.com/interview/2604/what-is-orientation) changed .

I tried but always the savedInstanceState [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) in [null](https://www.mindstick.com/forum/33922/how-to-use-null-coalescing-operator-in-c-sharp)

if(savedInstanceState==null){

savedInstanceState=new Bundle();

savedInstanceState.putBoolean("isLogoLoaded",[true](https://yourviews.mindstick.com/view/81326/boycott-chinese-products-dream-will-come-true));

}else{

savedInstanceState.putBoolean("isLogoLoaded",true);

}

please provide the better way thanks .

## Replies

### Reply by Norman Reedus

Which method are you calling that logic?

I am guessing that is in onCreate(), onCreate is where you LOAD the savedInstanceState, it is NOT where you SAVE your data. (you can also load it in onRestoreInstanceState)

You want to save your data in public void onSaveInstanceState(Bundle savedInstanceState) {

@Override

public void onSaveInstanceState(Bundle savedInstanceState) {

super.onSaveInstanceState(savedInstanceState);

savedInstanceState.putBoolean("isLogoLoaded", true);

}


---

Original Source: https://www.mindstick.com/forum/12934/how-to-get-boolean-from-savedinstancestate-on-orientatioin-change

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
