5
I have the following problem in my application:
When the user turns off the screen on the tablet, turn the screen again, rotates to the vertical position and logs in android again, a
Activity
user was destroyed and back to the application login screen.This problem only occurs in
Activity
which have a list ofAdapter
has an XML that contains a value property 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 define the padding
, to Activity
is destroyed. If I pass any value "10dp" for example, the Activity
is maintained when the user performs the procedure described above.
Obs. Activity
reported already has in the Manifest the tag android:configChanges="orientation|screenSize
that serves not to destroy the Activity
when the tablet rotate.
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 the tag orientation|screenSize placed in the Manifest only works in Activitys that nay utilize @dimen in their XML?
I noticed you are releasing this error: Binary XML file line #3: Binary XML file line #3: You must Supply a layout_height attribute. Caused by: java.lang.Unsupportedoperationexception: Binary XML file line #3: You must Supply a layout_height attribute
– P. Dev
It occurs when I turn the tablet and it tries to inflate in XML again. The impression I got is that the attribute lost the value that came from @dimen, that is, this empty.
– P. Dev