I have the following problem in my application:
-
When the user shuts off the screen on the tablet, turns the screen back on, rotates to the vertical position, and logs on the android again, the
Activity
that the user was is destroyed and returns to the login screen of the application . - This problem only occurs in
Activity
which has a list whoseAdapter
has an XML that contains a property valued using@dimen.xml
.
Example:
View row = LayoutInflater.from(mContext).inflate(R.layout.custom_attachment_list_item,
parent, false);
My XML:
<?xml version="1.0" encoding="utf-8"?>
<TextView android:layout_width="20dp"
android:padding="@dimen/sp_gen_xl_15dp"
android:text="@dimen/sp_box_margin_left"
android:layout_height="10dp"
xmlns:android="http://schemas.android.com/apk/res/android" />
That is, if I use android:padding="@dimen/sp_gen_xl_15dp"
to set padding
, Activity
is destroyed. If I pass any value "10dp" for example, Activity
holds when the user performs the procedure described above.
Note:% reported% already has in Manifest the Activity
tag that serves not to destroy android:configChanges="orientation|screenSize
when the tablet p>
Example:
<activity
Activity"
android:keepScreenOn="true"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize"></activity>
The big question is: Why tag orientation | screenSize placed in Manifest only works in Activitys do not use @dimen in your XML ?