Ver mensagens sem resposta | Ver tópicos ativos Hoje é 18 Nov 2019, 13:39



Responder Tópico  [ 1 Mensagem ] 
 Erro Unable to start activity 
Autor Mensagem
What is Android?
What is Android?

Data de registro: 09 Out 2019, 23:55
Mensagens: 1
Mensagem Erro Unable to start activity
ERRO

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.colpetprojeto, PID: 10303
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.colpetprojeto/com.example.colpetprojeto.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void androidx.appcompat.widget.DecorContentParent.setWindowCallback(android.view.Window$Callback)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void androidx.appcompat.widget.DecorContentParent.setWindowCallback(android.view.Window$Callback)' on a null object reference
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:611)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.colpetprojeto.MainActivity.onCreate(MainActivity.java:21)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
at android.os.Handler.dispatchMessage(Handler.java:107) 
at android.os.Looper.loop(Looper.java:214) 
at android.app.ActivityThread.main(ActivityThread.java:7356) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
I/Process: Sending signal. PID: 10303 SIG: 9
Disconnected from the target VM, address: 'localhost:8625', transport: 'socket'


Codigo MainActivity ( Nenhum erro, segundo o software )
package com.example.colpetprojeto;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;


public class MainActivity extends AppCompatActivity {


    Dialog myDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        myDialog = new Dialog(this);

        Button buttonmain = findViewById(R.id.buttonmain);

        buttonmain.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Intent it = new Intent(MainActivity.this, MapMain.class);
                startActivity(it);
            }
        });
    }
    public void ShowPopup (View v){
        TextView txtclose;
        myDialog.setContentView(R.layout.custompopup);
        txtclose = myDialog.findViewById(R.id.txtclose);
        txtclose.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                myDialog.dismiss();
            }
        });
        myDialog.show();




    }
    public void ShowPopup1 (View v){
        TextView txtclose;
        myDialog.setContentView(R.layout.popupshop);
        txtclose = myDialog.findViewById(R.id.txtclose);
        txtclose.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                myDialog.dismiss();
            }
        });
        myDialog.show();
    }

}
 


Android Mainfest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.colpetprojeto">


    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">


        <meta-data android:name="com.google.android.geo.API_KEY"
            android:value="@string/map_key"/>



        <activity android:name=".MainActivity">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />


                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAP" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name=".MapMain">
        <intent-filter>
            <action android:name="android.intent.action.MAP" />

            <action android:name="com.example.colpetprojeto.MapMain"/>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        </activity>


        <activity android:name=".Config">
            <intent-filter>
                <action android:name="android.intent.action.MAP" />

                <action android:name="com.example.colpetprojeto.Config"/>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

    </application>

</manifest>


Se alguem souber o que pode ser, preciso desenvolver este aplicativo que faz parte de um projeto de conclusão de curso de T.I.


09 Out 2019, 23:58
Perfil
Mostrar mensagens anteriores:  Organizar por  
Responder Tópico   [ 1 Mensagem ] 

Quem está online

Usuários vendo este fórum: Aderbal Nunes, adilson, adolfo, alexandreizumi, alexsander.miranda, allone, alsimoes, alylson, andreleitao, andrelom, Aparec, ARAKINIDIO, arilsonm, arnaldo.miranda, AT-AT, Augusto, axellsan, azero, Bass, BMaia, breko, Bruno, buccalon, caiodemarco, Caique, cehills, cleber, cleberkct, Daniel Batista, dariosena, dbuarque, deborazb, Diego Rufino, Dirceu W. C. Conte, dirceuconte, DITÃO, dnakamashi, Douglas Siviotti, dr.faro, dramos, Dudi_FC, edlinux, eloilton, erikopa, estratec, fabric01, fabricioLeonard, Felipe, ffardo, flaviohssantos, flaviojps, Gomes, Governador Wilhuff Tarkin, guiba_picolino, gutomilani, jacksaum, JeffCF, JMurray, jpespindola, jrchuteboxe, juniorfranca, Juniorvs, Ki-Adi-Mundi, kleberperea, Kureiton, lazarodm, leandroviana, loferreira, luizcesar, luizcyber, luizneto79, marcelosv, marlovich, Mig, mirelli, mmiottobarbosa, mrkensley, MSN NewsBlogs, nishimura.ichigo, nullPointer, Nute Gunray, onaiggac, Orivalde, Padawan, paulanegreiros, pererinha, persiomotta, pilon, pmzara, Qui-Gon Jinn, Rafael, rafaelvital, regeriob2br, renatodondoni, rfrafa, ricardoogliari, ricardzanella, Rickxdx, RodReis, Roll, Rubens Prates, rubens_olv, Rufino, sephct, sergio, shibutani, skcratch, Snappy [Bot], soulmachine, tchou, the_hulk_knifer, thiagoalgo, thiaguim, Tiago Sousa Roch, tonholis, unnamedd, vaniuz, vicfalmac, voliverio, washington, wender, Wesleyceraso, wil, wilsond, YaCy, zaquiel e 23 visitantes


Você não pode criar novos tópicos neste fórum
Você não pode responder tópicos neste fórum
Você não pode editar suas mensagens neste fórum
Você não pode excluir suas mensagens neste fórum
Você não pode enviar anexos neste fórum

Procurar por:

© 2007 - 2016 Portal Android - Comunidade de Desenvolvedores Android

Estamos no Linkedin    Siga-nos no twitter


Powered by phpBB - Hospedado por Bemobi