mirror of https://github.com/M66B/FairEmail.git
Log saved instance size
This commit is contained in:
parent
9e4d3bb76a
commit
2a588443f2
|
@ -68,6 +68,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
int before = Helper.getSize(outState);
|
||||
super.onSaveInstanceState(outState);
|
||||
int after = Helper.getSize(outState);
|
||||
Log.i("Saved instance " + this + " size=" + before + "/" + after);
|
||||
for (String key : outState.keySet())
|
||||
Log.i("Saved " + key + "=" + outState.get(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
Log.i("Resume " + this.getClass().getName());
|
||||
|
|
|
@ -55,8 +55,14 @@ public class FragmentBase extends Fragment {
|
|||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
Log.i("Save instance " + this);
|
||||
int base = Helper.getSize(outState);
|
||||
super.onSaveInstanceState(outState);
|
||||
int before = Helper.getSize(outState);
|
||||
outState.putString("fair:subtitle", subtitle);
|
||||
int after = Helper.getSize(outState);
|
||||
Log.i("Saved instance " + this + " base=" + base + " size=" + before + "/" + after);
|
||||
for (String key : outState.keySet())
|
||||
Log.i("Saved " + key + "=" + outState.get(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,6 +42,7 @@ import android.net.NetworkInfo;
|
|||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.PowerManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Display;
|
||||
|
@ -1153,4 +1154,10 @@ public class Helper {
|
|||
return organization;
|
||||
}
|
||||
}
|
||||
|
||||
static int getSize(Bundle bundle) {
|
||||
Parcel p = Parcel.obtain();
|
||||
bundle.writeToParcel(p, 0);
|
||||
return p.dataSize();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue