• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help R.id messed up during designing the app

Neo Sluf

Lurker
Dec 31, 2014
2
0
One day I designed an idea about an app. I decided to make it and focus first on designing and after that coding.

So I created my project and start working with the designs. Start adding buttons, textviews, etc. Changing their id buttons etc. (I decided to work with the drag n' drop way and not on the codes).

I am done!.. I am ready now to code. Then i type mybutton = Button findViewById (R.id.menubutton) then an error appears (R.id.menubutton does not exist!) what the f@$$@! I go back to my layouts and look on my menu button and its id is id@menubutton!.... what the hell happened?.. I change the name but problems got worst. Not all the id in the layout doesn't exist. I am messed up with the R.id.

I rebuilt my project and copy paste the code and creating new layouts. And after finishing (BOOM AGAIN). And this is really frustrating and decided to open the R.id.java and messes it up. But still nothing happens.

Because my enthusiasm is still there I REBUILT AGAIN MY APP. Now this time I decided not to focus on heavy designing. With less buttons, everything. I finally finished my app. Phew!....

After a week inactivity I decided to continue again on my app by adding more designs and this problem threatens me again.

MY QUESTION

1.) Are the ids you put in the button got messed up? (Throwing some unusual errors like not existing when you code it. Or let say it ids that are not registered at R.id)

2.) I am thinking that maybe this problem occurs when you use the drag n' drop style of designing your app most of the time. Can this be a cause?

Btw, in order to prove myself this is a bug i tried to reproduce it. And the way to produce that bug (mess up with the R.id) Is use the drag n' drop designing a lot. Well as you can see when you add a button, it instantly put the default id and just rename it. And renaming the id causes the problem. The problem is when I rename one id of a button it messed up everything that id you made on your buttons won't show up when you add it with your code.

SORRY IF MY QUESTION IS VERY CONFUSING BECAUSE I AM ALSO CONFUSED ON WHAT HAPPENING ON THIS ONE. PLEASE I NEED HELP....
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones