B
B
b00blik2015-05-15 01:05:36
Android
b00blik, 2015-05-15 01:05:36

Android launching the wrong layout?

There is an application with several activities, on the main activity there is a change of layouts by keystrokes. Approximate number of layouts - 40.
There was a problem. Let's say there is layout number 26, and it should be displayed as the 26th in a row, but for some reason, the previous number, 25th, is substituted for it. If we put the layouts in random order, then again, the 25th layout will appear instead of the 26th!
All layouts have the same type of name: activity_xx.xml where xx is the number of the layout.
I thought that the problem was in the name of the layout I needed, I changed it, and accordingly changed its name in the setContentView () method;
The problem hasn't been resolved. I decided to see what is in the R-class for these layouts. They have completely different meanings, which means they are not confused and should be placed separately!

public static final int activity_26=0x7f0a00fa;
public static final int activity_25=0x7f040038;
public static final int activitym_26=0x7f040069;

But this does not happen, and activity_25 is set, as it were , even if I write activitym_26.
I do the same actions for layout and layout-large, the result is the same on emulators and on different devices.
I'm using Android Studio 1.1.0, the project's targetsdk is 16, the project's minsdk is 8. Of
course, I did Clean Project and Rebuild Project.
Moreover, I recreated the project in Android Studio, the situation has not changed.
Has anyone had a similar situation and how did you solve it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris K., 2015-05-16
@b00blik

If you iterate over a switch, check for the presence of break everywhere, judging by the code example in your previous comment, it is missing.

O
one pavel, 2015-05-15
@onepavel

And this problem has nothing to do with the fact that in programming the countdown starts from 0 ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question