tutorial 14/15 - can't get the code to work

0 Morgan Flament · May 5, 2015
Hey everybody!

Has the title might suggest, I'm pretty new at Android development and programing all together but I'm trying to follow Bucky's tutorials and I like it so far.

I have a problem here with rendering the code Bucky tells us in tutorial 14/15 that is supposed to center the button on my main activity. I feel like I entered the code correctly, as Bucky explains, but my emulator never takes the change.

For info, as I was starting the Android tutorials, I realized that ActionBarActivity wasn't working and replaced it with AppCompatActivity, it's info, but I have no clue if it's related, I'm just trying to give you guys as much details I can think of to get some help.

Anyway, I hope someone here can help me moving forward :)




Post a Reply


Oldest  Newest  Rating
0 Morgan Flament · May 7, 2015
Anybody here ? Also, I was wondering if I could maybe try to look for a solution to my problem in the source code, but the search engine doesn't bring me any result and I can't seem to find it. Maybe I'm too high...
0 Rich Sharma · May 7, 2015
Give me your code and i will check any mistakes. Mbye you forgot to add to the layout the button as well as the position with layout params. make sure you add

layout.add(positions, button); 

that is the most logical solution i would think.
0 Odd Gunnar Bjørgen · May 8, 2015
Hey Morgan,

if you try to edit the " morganslayout.addview(redbutton)" field and make it like this.

morganslayout.addview(redbutton, buttonDetails)
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator