Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

the properties menu does not show up on the side how do i get it

while editing the layout the properties menu does not show up

7 Answers

Just got round to checking that in code. It works fine.

I've added a member variable for the layout, of type RelativeLayout, then assigned an id to the layout in the XML.

Here's my adjustments to the Fun Fact app ...

activity_fun_facts.xml
<RelativeLayout ... 
.
.
android:id="@+id/layout">
FunFactsActivity.java
// at the top of the class
private RelativeLayout mLayout;

// in onCreate
mLayout = (RelativeLayout) findViewById(R.id.layout);

// after onClick
mLayout.setOnClickListener(listener);

That works fine.

Steve.

Hi Meet,

On the right, there's the component tree with Properties too. On my version of Android Studio, I can show/hide this by clicking the words "component tree" in the side bar.

Screenshot

Let me know if that helps,

Steve.

yeaah thank you that helped

can you help me with the code to change the color of the background everytime you tap the screen

Sure! What's the problem with that?

Let me have details and I'll help you out.

Steve.

i want to make an app that when you touch the screen the color of the screen changes

OK. That's pretty straightforward. Have you done the Fun Facts app course? That has that functionality.

yeah but i dont want a button just tapping the screen should change the color . how do i do it i have been trying since 6 hours

I see. I'm out at the moment; let me have look when I get home.

ok thank you for the support .i will wait for your reply

Have you tried adding the onClickListener to the Id of the layout? That should work.