Cannot find symbol errors in Android Studio Tutorial? - java

https://developer.android.com/training/basics/firstapp/building-ui.html#Weight
I am doing the tutorial above and to get it to build I had to comment out these lines inside MainActivity.java inside src folder (This code is in the MainActivity class inside OnCreate()).
// Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
// setSupportActionBar(toolbar);
//
// FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
// fab.setOnClickListener(new View.OnClickListener() {
// #Override
// public void onClick(View view) {
// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
// .setAction("Action", null).show();
// }
// });
If I do not comment out these lines, I get 'cannot find' errors and can't build, example:
error: cannot find symbol variable toolbar
Can someone explain in plain english why this is happening and how I can fix it? I have tried various import.R fixes that people found to combat Eclipse randomly adding that, but they don't work. My imports:
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
I am using Android Studio like the tutorial says and get the same error on a clean install. Is it my automatically generated imports? Is the tutorial wrong or incompatible with the latest Android Studio? Are my build settings wrong?

The R class is auto-generated based on what is in your *.xml files, whether they are strings, dimensions, colors, ids within layouts, etc.
When you are calling code like this:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
You are saying, "Set the toolbar variable to the widget with an id of toolbar".
In an xml, say you had three textviews like this:
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/text_view_1" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/text_view_2" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/text_view_3" />
When I build the project, my R.java file will then be updated to have references in java code to those ids that I defined in xml, like this:
public static final int text_view_1=0x7f0c0066;
public static final int text_view_2=0x7f0c0067;
public static final int text_view_3=0x7f0c0068;
To explain it at a very basic level, the R.java file is java code that is generated to reference xml elements within actual java code.
I am guessing that when you created a project in Android Studio, it came with the MainActivity.java class. That's where that code is coming from that you posted above. The part right above that in the default MainActivity.java class is
setContentView(R.layout.activity_main);
This is setting the activity's view to the xml layout file defined in activity_main.xml. Inside of this layout is the following
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:fitsSystemWindows="true"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="#style/AppTheme.AppBarOverlay"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/fab_margin"
android:src="#android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
My guess is that perhaps your activity_main.xml does not contain this definition for the Toolbar and the FloatingActionButton widget.
If you want to really start from scratch so that you can follow the tutorial you linked, you should delete the MainActivity.java and just go create your own.

I know this is old, but I'm going to answer because this tutorial is still the best for android studios, and it poorly explains this part.
OnCreate() creates the elements you define in XML in Java, by creating the default activity, you still have a
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
and a
fab.setOnClickListener(new View.OnClickListener()
defined in OnCreate, android studios as not created these resources in android.R because you deleted there definitions in XML as part of the tutorial!

Run>Clean and Rerun'app' or ctrl+F5 on Android Studio

Related

Bottom Navigation Bar pushes down when changing between fragments

In my activity i have a bottom navigation bar and the frame layout to show the fragments everything works fine but the problem is when i start moving from 1 - 4 in sequence the bottom navigation bar stays in its position but when i jump suddenly from 4 to 2 then the bottom navigation bar goes out of screen and when again clicked on the same item then it comes to normal position.
This video will clearly help you get what my problem is Click to watch.
as i guess this is a major problem when considering the UI so kindly help me how can i achieve this. For making things easier i'm posting my codes which contain these elements.
activity_appMain.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AppFragments.AppMain">
<FrameLayout
android:id="#+id/fragments_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/navigation_bar"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/navigation_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?android:attr/windowBackground"
app:labelVisibilityMode="labeled"
app:menu="#menu/bottom_navigation" />
</RelativeLayout>
AppMain.java
package com.coderedinnovations.allioservices.AppFragments;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.MenuItem;
import android.view.WindowManager;
import com.coderedinnovations.allioservices.AppFragments.FeedbackFragment;
import com.coderedinnovations.allioservices.AppFragments.HomeFragment;
import com.coderedinnovations.allioservices.AppFragments.MyOrdersFragment;
import com.coderedinnovations.allioservices.AppFragments.MyProfileFragment;
import com.coderedinnovations.allioservices.R;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.firebase.iid.FirebaseInstanceId;
public class AppMain extends AppCompatActivity {
public void adjustFontScale(Configuration configuration){
configuration.fontScale = (float) 0.9;
DisplayMetrics metrics = getResources().getDisplayMetrics();
WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
wm.getDefaultDisplay().getMetrics(metrics);
metrics.scaledDensity = configuration.fontScale * metrics.density;
getBaseContext().getResources().updateConfiguration(configuration, metrics);
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app_main);
adjustFontScale(getResources().getConfiguration());
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
BottomNavigationView bottomNavigationView = findViewById(R.id.navigation_bar);
bottomNavigationView.setOnNavigationItemSelectedListener(navigationItemSelectedListener);
getSupportFragmentManager().beginTransaction().replace(R.id.fragments_container, new HomeFragment()).commit();
}
private BottomNavigationView.OnNavigationItemSelectedListener navigationItemSelectedListener =
new BottomNavigationView.OnNavigationItemSelectedListener() {
#Override
public boolean onNavigationItemSelected(#NonNull MenuItem menuItem) {
Fragment selectedFragment = null;
switch (menuItem.getItemId()){
case R.id.nav_home:
selectedFragment = new HomeFragment();
break;
case R.id.nav_orders:
selectedFragment = new MyOrdersFragment();
break;
case R.id.nav_feedback:
selectedFragment = new FeedbackFragment();
break;
case R.id.nav_profile:
selectedFragment = new MyProfileFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.fragments_container,selectedFragment).commit();
return true;
}
};
}
I looked for a similar question like this but none of them have been answered
Edit: Issue only appears when i press from back to front but when i'm going from 1-4 the issue doesn't arise but when i click suddenly from 4 to any other tab the bar gets pushed down.
I really thank everyone's effort for helping me in solving the issue. but somehow i sorted out the problem by my own. In the four fragments one of the fragment I mean the last fragment have the Co-ordinator layout as the parent layout so that what made the bottom bar to push down.
so i solved the issue by taking Constraint layout as the parent layout and added the child into that. thanks for everyone again.
Try this:
1.Add bottom margin 55 dp to framelayout.
2. remove the layout_above from framelayout.
3. add parent top true, center in parent true.
I actually did a layout quite different from yours in a similar enough scenario. Let me modify it and see if this works. In my case instead of a FrameLayout I use a relative layout with a scrollview inside, to allow content of any height. This sets the bottom bar to float at the bottom always.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="#+id/fragments_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/navigation_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
app:labelVisibilityMode="labeled"
app:menu="#menu/bottom_navigation" />
</LinearLayout>
In the off chance the frame layout doesn't behave correctly, then wrap it with a relative layout, though I do not think you shall need to.
I'v already watched your video. I copied your code and run it in my workspace, but it works fine. So I actually don't know where the problem lies. Have you consider using ConstraintLayout? I tried to change your xml layout into ConstraintLayout and it also works fine.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="#+id/fragments_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toTopOf="#id/navigation_bar"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/navigation_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:labelVisibilityMode="labeled"
app:menu="#menu/bottom_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
The constraint of BottomNavigationView to the bottom of parent will make it stay at the bottom. And don't forget to constaint your FrameLayout with BottomNavigationView so that they are not overlayed with each other.
I was facing the same problem. This was mainly because of using coordinatorlayout in the inner screens. Any screen having coordinatorlayout makes the bottom navigation (placed on top) move from its location.
https://stackoverflow.com/a/59844009/13124119 - this answer worked for me also!
In the four fragments one of the fragment I mean the last fragment have the Co-ordinator layout as the parent layout so that what made the bottom bar to push down.
so I solved the issue by taking Constraint layout as the parent layout and added the child into that.
and you have to add the following attributes to Co-ordinator layout.
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

Tabs > fragments with different layout + actions

I'm new to android studio / java language.
I need to set up a pretty straightforward app, but the information I find doesn't let me solve the problem.
Can any of you help :)?
I want to make an app with 3 tabs
(first tab) user enters a decimal number, and after click of a button the result shows a value calculated with the means of a formula
(second tab) same as first tab but with values and formulas
(third tab) information of each formula
I've implemented a (for this use, simplified) code for the first tab.
I know how to code all the three tabs separately, but I don't know how
to merge them together in one app with 3 tabs.
I started with the tabs-template given in android studio, but it demands that every tablayout is the same. I've seen a lot of answers how to have different layouts for each tab, but how do I code the different tabs (e.g. setonclicklistener).
Second problem is that every solution uses android and I have androidx, so the imports won't take. And in dependencies I don't find design V7 or anything of that sort.
Mainactivity.java:
package com.example.soloapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.text.DecimalFormat;
public class MainActivity extends AppCompatActivity {
DecimalFormat numberFormat = new DecimalFormat("#.0");
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button calcButton = (Button) findViewById(R.id.calcButton);
calcButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view){
EditText editNum = (EditText) findViewById(R.id.editNum);
TextView resultTextView = (TextView) findViewById(R.id.resultTextView);
double cysC = Double.parseDouble(editNum.getText().toString());
double tempResult = Math.pow(cysC,-0.931);
double resultLong = 70.69 * tempResult;
String result = numberFormat.format(resultLong);
resultTextView.setText(result);
}
});
}
}
activy_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:id="#+id/editNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:ems="10"
android:inputType="numberDecimal"
app:layout_constraintBottom_toTopOf="#+id/resultTextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/resultTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginBottom="168dp"
android:text="Result"
app:layout_constraintBottom_toTopOf="#+id/calcButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="#+id/calcButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="200dp"
android:text="CALCULATE"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
I'll add what you need to learn in order to create what you told.
You need to use ViewPager in Android to create swipeable tabs. (If you know WhatsApp, those swipeable three tabs are ViewPager).
You can learn more about ViewPager here.
For using ViewPagers, you need to learn what Fragments are, Fragments in Android are like small activities(but not activities). You embed these Fragments inside your Activities, so you need to put these Fragments inside the Activity that contains your ViewPager.
You can learn about Fragments here.
Although, the first ViewPager link will be sufficient for you to learn everything that you need to learn about creating Swipeable Tabs.
About the second problem that you mentioned.
According to Migrating to AndroidX,
Androidx only maps the original support library API packages into the
androidx namespace.
Basically, they just renamed the package name so that it'd be easy for them to support the updates to libraries.
You can easily find the corresponding androidx package from here.
Migrating to Androidx.

Java activity calling a fragment

First le me start by stating I am fairly new to Java and Android Studio, so please bear with me. my background has been in Visual Basic going way back.
I have an activity that tries to verify that what was entered is a valid Item Number by UPC entered. When only one match all is good. My problem starts when the UPC entered brings back more than one matching item. What I am attempting to do (First time using fragments) is Replace part of the screen with a recycler view showing the matching items and descriptions.
When comes backs with multiple items I call an event called setupMulitpleItems with the following code:
public void setupMultiItems(String mScan){
Timber.d("Multiple matching Items");
Bundle bundle = new Bundle();
bundle.putString("valuesArray",mScan);
SelectItemFragment fragobj = new SelectItemFragment();
fragobj.setArguments(bundle);
FragmentManager fragmentManager=getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.include2, fragobj);
fragmentTransaction.commit();
Not sure how many parts of this code will actually work but I am getting underline on the replace line.
"'replace(int, android.app.Fragment)' in 'android.app.FragmentTransaction' cannot be applied to '(int, com.procatdt.stockright.activities.SelectItemFragment)'"
meesage.
I am using the following imports for Fragments.
import android.app.FragmentTransaction;
import android.app.Fragment;
import android.app.FragmentManager;
Figured I would also include the XML for the activity that is currently running when I want to use Fragment.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorBackgroundGray"
tools:layout="#layout/fragment_select_item"
tools:context="com.procatdt.stockright.activities.PutAwayAreaActivity">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<include
android:id="#+id/include2"
layout="#layout/frm1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_gravity="left" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:paddingLeft="5dp"
android:orientation="vertical">
<include
android:id="#+id/include"
layout="#layout/layout_numpad5"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="220dp"
android:layout_weight="1"
android:layout_gravity="right"
/>
</LinearLayout>
</RelativeLayout>
I am trying to replace include2 with Fragment.
Hope this enough info but if anyone needs to see more let me know and I ill attach code.
You just need to pass the object of your fragment to replace method, there is no need to pass the class declaration and type of class
so just remove
// this is enough
fragmentTransaction.replace(R.id.include2, fragobj);
// remove this
//fragmentTransaction.replace(R.id.include2,android.app.Fragment SelectItemFragment);

The listView is not displaying items in the Design tab, but is displaying in the emulator

The problem is that, the listView is not displaying correctly in the design tab of my activity_main xml, but is displaying correctly in the emulator that is running. This is inconvenient since, its pretty convenient to see the design in the Design tab.
Please tell me how to solve this.
emulator with design tab image
My code is as follows:`
1.Main_activity.java:
package com.example.lemonade.app1;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.example.lemonade.app1.R;
public class MainActivity extends Activity {
// Array of strings...
String[] mobileArray = {"Android","IPhone","WindowsMobile","Blackberry","WebOS","Ubuntu","Windows7","Max OS X"};
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArrayAdapter adapter = new ArrayAdapter<String>(this, R.layout.activity_listview, mobileArray);
ListView listView = (ListView) findViewById(R.id.mobile_list);
listView.setAdapter(adapter);
}
}
main_activity.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ListActivity" >
<ListView
android:id="#+id/mobile_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
Strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ListDisplay</string>
<string name="action_settings">Settings</string>
</resources>
activity_listview.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Single List Item Design -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/label"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dip"
android:textSize="16dip"
android:textStyle="bold" >
</TextView>
I can think on 2 problems that you may have:
1)Please check the min SDK in you'r app module and the phone you are trying to run the app on maybe the min SDK is higher then you'r phone.
2)You trying to show image View on you'r list View and they coped as "V21",When you trying to copy image into your drawable library it give you 2 option regular image or V21 for some reason the v21 don't show on phones and on emulators they do,well for me at least because i had the same problem and it solve it to me.
If one of these didnt helped try to debug it and tell me what results you got.
Are you referring to the action bar showing in your design but not the emulator? It sounds like you have your app theme set to include an action bar and your design preview is showing it assuming you are using it.
I can't test it right now but I believe if you don't explicitly set up your options in your activity by overriding onCreateOptionsMenu(), which you aren't, it will not show the action bar when you run your app.
You can check your app theme in your manifest and/or styles.xml, look for
"android:theme="#style/AppTheme"
Which points to styles.xml in my case.
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
If you change the parent to something without the action bar, Theme.AppCompat.NoActionBar for example, it will not show in your design window.

Android, ActionBar hiding other widgets

Disclaimer: It's build with CLI only tools, so certainly some "auto-generated lines" are missing
It's a small application with a MainActivity with a EditText and a Button
It works fine, but if I extends now from ActionBarActivity now my EditText and Button are hidden behind the Action Bar
https://developer.android.com/guide/topics/ui/actionbar.html The android documentation does not state about changes needing to be made in the layout.xml nor does the Training guide from which my application is based on
My MainActivity.java
public class MainActivity extends ActionBarActivity
{
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// adding these lines show that the widget are correctly added
//ActionBar actionBar = getSupportActionBar();
//actionBar.hide();
}
}
My main layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<EditText
android:id="#+id/enter_verb"
android:hint="#string/enter_verb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:text="#string/button_conjugate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
My guess would be that I need to add something in my layout to make it aware there's a Action Bar, but I can't find anywhere what it should be.
Very strange, I've added the line coming from this link
https://developer.android.com/training/basics/actionbar/overlaying.html
Which is:
android:paddingTop="?attr/actionBarSize"
in my LinearLayout tag, and then recompiled, after that the widget were shown but with a padding of the size of the actionBar in addition to the actionBar itself.
I then removed the line, recompiled and it now works as expected
A bug because of temporary files?

Categories