BNK
BNK

Reputation: 24114

Issue when adding new Activity in Android Studio 1.3.2

I have a strange problem when adding new Activity in Android Studio 1.3.2 (not error with older versions):

If dimens.xml file inside "\app\src\main\res\values-w820dp" is READ-ONLY, when add new Activity (File - New - Activity...), only menu xml file created, AndroidManifest.xml updated, but ...Activity.java and layout xml not created.

Like the following screenshot:

enter image description here

If unset read-only from that dimens.xml file, everything works normally. I really don't understand why so. Since after the activity created, I find "Date-modified" or "Accesed" property of dimens.xml not changed.

Upvotes: 0

Views: 465

Answers (1)

Camelyn Fajardo
Camelyn Fajardo

Reputation: 86

It is because the developers made auto-creation of the resources comes ahead before the java file, and it encountered uncaught File exception during creation. So basically, when it tried to execute the command of writing dimens.xml it throws an exception because it can't be written, everything else except what's ahead the xml is not created. As for why date-modified did not change, it is because it checks the content before writing in which, if it has the value activity_horizontal_margin, the writing for that xml cancels/exits. Try removing it, you will see the date modified if you reproduce the event. And yes, this should be reported as bug.

Upvotes: 2

Related Questions