Remove All Ads from XDA

TooBar problem using Outlined text fields

1 posts
Thanks Meter: 0
By 1lbert0, Junior Member on 9th June 2019, 08:52 PM
Post Reply Email Thread
Hi everyone,
I'm trying to use a ToolBar in my android studio project. In build gradle(module app) I implements :
'' //I use this because i want '< ayout>' on my xml/layout files,
testImplementation 'junit:junit:4.12'.
In MainActivity.Java:
public class MainActivity extends Activity {

protected void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = findViewById(;

If I use 'toolbar.inflateMenu(;' or 'setSupportActionBar(toolbar)' when I ran my app it crashs immediately.
I tried also 'setActionBar();' the brackets should be filled this way 'Toolbar toolbar' as 'toolbar' I put 'toolbar' ;
but I don't know what to put as 'Toolbar'.
I've looked for solution but always in the build gradle(module app) was implemented ''.
And if I implement both of them('' and '') my app crashs immediately.

Can anyone help me to set my toolbar as an ActinBar?
If you need more specification on my project feel free to ask.

Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes