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

Alex Hedley
Alex Hedley
16,381 Points

Android iOS Toolbar equivalent

Hi

I'm creating an app on both iOS and Android. I've not done Android dev before so this is new waters for me. The iOS one is mostly completed and now I've replicating it in Android. I'm using a web view to display a page. On this page I want to input a value into a textbox. On iOS I have a toolbar along the bottom of the app which has a button i click with allows me to enter the value I want to pass to the textbox.

Is there an Android equivalent of a toolbar?

I've done some research but not come across any tutorials that have helped, maybe I'm searching the wrong this.

I've looked at 'LinearLayout' is this the route to go down?

Any pointers would be helpful.

Thanks

1 Answer

Alex Hedley
Alex Hedley
16,381 Points

'activity.java'

private Toolbar toolbar;
toolbar = (Toolbar) findViewById(R.id.myToolbar);

In the 'activity.xml'

<android.support.v7.widget.Toolbar
    android:id="@+id/myToolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@color/orange"
    />