So I have this fab menu and each button have different activity what I want is to put the functions into one java file instead of creating a lot of java file to call different functions in the button
Here's the one of the java file - SVAuditorium.class
.
public class SVAuditorium extends AppCompatActivity {
private static final LatLng Auditorium = new LatLng(10.294335, 123.880809);
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.street_view);
SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
(SupportStreetViewPanoramaFragment)
getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(
new OnStreetViewPanoramaReadyCallback() {
@Override
public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
if (savedInstanceState == null) {
panorama.setPosition(Auditorium);
}
}
});
}
}
This is what I did to call the activities from the SVAuditorium
and the rest.
case R.id.fab_auditorium:
startActivity(new Intent(this, SVSAuditorium.class));
break;
case R.id.fab_library:
startActivity(new Intent(this, SVLibrary.class));
break;
case R.id.fab_main:
startActivity(new Intent(this, SVMainBuilding.class));
break;