MainActivity class : make the connection between first and second screen for the moment

This commit is contained in:
BGbaderguet 2020-11-08 01:27:07 +01:00
parent 61ab159447
commit 1a116d0b26
2 changed files with 8 additions and 15 deletions

View File

@ -1,25 +1,26 @@
package fr.romanet.vj.apps.myweather;
import android.widget.Button;
import android.content.*;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
import com.google.android.material.floatingactionbutton.FloatingActionButton;
private Button buttonAddCity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
buttonAddCity = (Button) findViewById(R.id.fab);
FloatingActionButton buttonAddCity = (FloatingActionButton) findViewById(R.id.fab);
buttonAddCity.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
public void onClick(View view)
{
openAddCityPage();
}
});
@ -27,7 +28,7 @@ public class MainActivity extends AppCompatActivity {
public void openAddCityPage()
{
Intent intent = new Intent(this, AddCity.class);
Intent intent = new Intent(MainActivity.this, AddCity.class);
startActivity(intent);
}
}

View File

@ -12,14 +12,6 @@
android:layout_height="wrap_content"
android:theme="@style/Theme.MyWeather.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="75dp"
android:background="?attr/colorPrimary"
app:title="MyWeather"
app:popupTheme="@style/Theme.MyWeather.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<ImageView