-1
package com.example.ConsultoriaRuiz;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Browser;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AlertDialogLayout;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import com.example.ConsultoriaRuiz.ui.home.HomeFragment;
import com.getbase.floatingactionbutton.FloatingActionsMenu;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.navigation.NavigationView;
import java.net.URI;
public class Sobre extends AppCompatActivity {
private AppBarConfiguration mAppBarConfiguration;
private Button btnreceita, btndespesa;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sobre);
Button btnreceita = (Button) findViewById(R.id.btnreceita);
DrawerLayout drawer = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
btndespesa.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), Sobre.class);
startActivity(intent);
// NÃO DÁ ERRO ALGUM, MAS O BUTTON NÃO CHAMA A PRÓXIMA TELA
// O BUTTON ESTÁ DENTRO DE UM POPUP
}
});
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
}
}
In your shared code the
btndespesa
nor receives a value. You shared the incomplete code or simply forgot to usefindViewById
to thebtndespesa
?– Rafael Tavares
It has value, not shared, friend...
– KAUAN VICTOR
None of the buttons perform the given function, is there any difference ? By being inside Popup
– KAUAN VICTOR
I don’t know what you mean by Popup, but the
findViewById
ofSobre
will only find elements that are inR.layout.activity_sobre
. If your buttons are in this layout, they will be found, otherwise they will not be.– Rafael Tavares
All buttons are in Layout and instantiated, Popup is basically a dialog
– KAUAN VICTOR
It does not give any error, runs and opens the APP normally, just does not perform the action of Buttons.
– KAUAN VICTOR