Created
January 18, 2017 19:42
-
-
Save Dayvidhms/38a83b80ca79c0a5a813ae0d10c35708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
tools:context="com.example.noite.provapratica.MainActivity"> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Quiz Filmes" | |
android:id="@+id/botaoFilmes" | |
android:layout_alignParentBottom="true" | |
android:layout_centerHorizontal="true" | |
android:layout_marginBottom="42dp" /> | |
<ImageView | |
android:layout_width="300dp" | |
android:layout_height="250dp" | |
android:id="@+id/imageView" | |
android:background="@drawable/logo" | |
android:layout_alignParentTop="true" | |
android:layout_centerHorizontal="true" /> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Quiz Games" | |
android:id="@+id/botaoGames" | |
android:layout_above="@+id/botaoFilmes" | |
android:layout_centerHorizontal="true" /> | |
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.noite.provapratica; | |
import android.content.Intent; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
public class MainActivity extends AppCompatActivity { | |
Button botaoGames; | |
Button botaoFilmes; | |
Intent intent; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
botaoGames = (Button) findViewById(R.id.botaoGames); | |
botaoFilmes = (Button) findViewById(R.id.botaoFilmes); | |
botaoGames.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
intent = new Intent(MainActivity.this, TelaGames.class); | |
startActivity(intent); | |
} | |
}); | |
botaoFilmes.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
intent = new Intent(MainActivity.this, TelaFilmes.class); | |
startActivity(intent); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment