Skip to content

Instantly share code, notes, and snippets.

@jemaf

jemaf/MainActivity.java Secret

Created May 18, 2016
Embed
What would you like to do?
Primeira versão do da Atividade principal com evento para redirecionamento para Atividade de cadastro de vídeos. EATI 2016.
package edu.ifmg.eati.movieme;
import android.content.Intent;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ListView moviesList = (ListView) findViewById(R.id.movies_list);
MoviesAdapter adapter = new MoviesAdapter(this);
moviesList.setAdapter(adapter);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.btn_new_movie);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, NewMovieActivity.class);
startActivity(intent);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment