MainActivity class : make the connection between first and second screen for the moment
This commit is contained in:
parent
daf4c67032
commit
61ab159447
@ -1,14 +1,33 @@
|
|||||||
package fr.romanet.vj.apps.myweather;
|
package fr.romanet.vj.apps.myweather;
|
||||||
|
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.content.*;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Button buttonAddCity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
buttonAddCity = (Button) findViewById(R.id.fab);
|
||||||
|
buttonAddCity.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
openAddCityPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void openAddCityPage()
|
||||||
|
{
|
||||||
|
Intent intent = new Intent(this, AddCity.class);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user