I’m try too restore string value, when screen is rotate, but it’s always null.
public class Main_screen extends Activity {
TextView t;
String path, ext;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_screen);
t = (TextView) findViewById(R.id.textView2);
if (savedInstanceState != null){
path = savedInstanceState.getString(path);
ext = savedInstanceState.getString(ext);
t.setText(getString(R.string.selected) + "\n" + path + "\n\n" + getString(R.string.unpr_new) + "\n" + path + ext);
}
}
When I rotate device, path and ext is null.
Need I save string manualy? Or it’s saved automatic when rotate in savedinstance?
check this if in the Manifest file you declaring
if you declared this flag, the activity will not be destroyed and recreated and the callback
and override this method :==>> onConfigurationChanged()
will be called.