Bom dia, pessoal. Estou com um problema que não consigo resolver, já fucei bastante nas postagens aqui e nos tutoriais do youtube e nada. Estou desenvolvendo um aplicativo android para um projeto na faculdade, mas não sou programador, decidi pelo app para aprender mesmo.
O que eu preciso é abrir uma imagem que está no drawable em uma lightbox ao clicar em um botão.
esse é o meu layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.editoratracos.jogotracos.hd"
android:background="@drawable/fundo"
android:id="@+id/telahd"
>
<ImageButton
android:id="@+id/botaoNovo3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="8dp"
android:background="@null"
android:onClick="chamaNovo"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="parent"
app:srcCompat="@drawable/novojogo"
android:layout_marginRight="70dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="70dp" />
<ImageButton
android:id="@+id/botaoComo2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="10dp"
android:background="@null"
android:onClick="chamaComo"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:srcCompat="@drawable/comojogar"
android:layout_marginEnd="10dp" />
<ImageButton
android:id="@+id/botaoHome"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="10dp"
android:background="@null"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:srcCompat="@drawable/home"
android:onClick="chamaHome"
android:layout_marginStart="10dp" />
<ScrollView
android:layout_width="368dp"
android:layout_height="400dp"
android:layout_marginRight="0dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="8dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="16dp"
android:layout_marginLeft="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_bias="1.0">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="600dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">
<ImageView
android:id="@+id/iconAla"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:background="@null"
android:cropToPadding="false"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ala"
android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/iconAyao"
android:layout_marginEnd="10dp"/>
<ImageView
android:id="@+id/iconAyao"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:background="@null"
android:cropToPadding="false"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ayao"
android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/iconBunzi"
android:layout_marginEnd="10dp"/>
<ImageView
android:id="@+id/iconBunzi"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:background="@null"
android:cropToPadding="false"
android:scaleType="fitCenter"
app:srcCompat="@drawable/bunzi"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<ImageView
android:id="@+id/iconGleti"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:background="@null"
android:cropToPadding="false"
android:scaleType="fitCenter"
app:srcCompat="@drawable/gleti"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/iconBunzi"
android:layout_marginStart="10dp" />
<ImageView
android:id="@+id/iconIemanja"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:background="@null"
android:cropToPadding="false"
android:scaleType="fitCenter"
app:srcCompat="@drawable/iemanja"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/iconGleti"
android:layout_marginStart="10dp" />
<ImageView
android:id="@+id/iconMbaba"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:background="@null"
android:cropToPadding="false"
android:scaleType="fitCenter"
app:srcCompat="@drawable/mbaba"
android:layout_below="@+id/iconAla"
android:layout_alignStart="@+id/iconAla"
android:layout_marginTop="10dp" />
</RelativeLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
e essa é a minha classe:
package com.editoratracos.jogotracos;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class hd extends AppCompatActivity {
@Override
public void onBackPressed(){
startActivity(new Intent(this, hd.class));
finishAffinity();
return;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hd);
}
public void chamaComo(View v) {setContentView(R.layout.activity_como);}
public void chamaHD(View v) {setContentView(R.layout.activity_hd);}
public void chamaNovo (View v) {setContentView(R.layout.activity_novo);}
public void chamaSobre (View v) {setContentView(R.layout.activity_sobre);}
public void chamaComecar (View v) {setContentView(R.layout.activity_comecar);}
public void chamaHome (View v) {setContentView(R.layout.activity_inicial);}
}