Why is my app in Android Studio freezing when I press a button?

-4

I had made an app (in Android studio 3.0.1) that tells whether the number which was entered is a triangular number, or a square number, or both, or none. However, when I enter a number and press the "enter" button, the app just freezes, and stops responding. I tried changing the type of loops (for/while)...but it did not yield any result.

I have given below the .java code...

package com.example.home.numbershape;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {




    class testNumber {
        int n;
        int i = 0;
        int tTestnum;
        int sTestNum;
        boolean triangular;
        boolean square;

        boolean triangleTest(){
            while( tTestnum <= n){
                int tTestnum = i*(i+1)/2;

                if( n == tTestnum){
                    triangular = true;
                } else if(n > tTestnum){
                    i++;
                } else {
                    triangular = false;
                }

            }
            return triangular;
        }

        boolean squareTest(){

            while( sTestNum <= n){
                int sTestNum = i*i;

                if( n == sTestNum ){
                    square = true;
                } else if(n > sTestNum){
                    i++;
                } else {
                    square = false;
                }
            }
            return square;



        }


    }





    public void submitFunction(View view){

        testNumber num = new testNumber();

        EditText inNum = (EditText) findViewById(R.id.inputNum);
        String nString = inNum.getText().toString();
        num.n = Integer.parseInt(nString);


        if(num.triangleTest()){
            if(num.squareTest()){
                Toast.makeText(this, "It is both a triangular and a square number!", Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(this, "It is a triangular number.", Toast.LENGTH_LONG).show();
            }

        } else if(num.squareTest()){
            if(num.triangleTest()){
                Toast.makeText(this, "It is both a triangular and a square number!", Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(this, "It is a square number.", Toast.LENGTH_LONG).show();
            }
        }
         else {
            Toast.makeText(this, "It is neither.", Toast.LENGTH_LONG).show();
        }

        Log.i("Info", "Submitted and checked.");



    }





    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }
}

Here is the .xml code a well...

<?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.example.home.numbershape.MainActivity">

    <EditText
        android:id="@+id/inputNum"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="21dp"
        android:layout_marginEnd="84dp"
        android:layout_marginStart="85dp"
        android:layout_marginTop="33dp"
        android:ems="10"
        android:hint="enter the number."
        android:inputType="number"
        android:selectAllOnFocus="true"
        android:singleLine="false"
        app:layout_constraintBottom_toTopOf="@+id/submitButton"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="292dp"
        android:layout_height="113dp"
        android:layout_marginBottom="33dp"
        android:layout_marginEnd="46dp"
        android:layout_marginStart="46dp"
        android:layout_marginTop="29dp"
        android:text="This app tells you whether the number which you have typed in is a Square number, triangular number, both or none. So give it a go!"
        android:textAlignment="center"
        android:textSize="18sp"
        app:layout_constraintBottom_toTopOf="@+id/inputNum"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/submitButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="221dp"
        android:layout_marginEnd="148dp"
        android:layout_marginStart="148dp"
        android:layout_marginTop="21dp"
        android:onClick="submitFunction"
        android:text="enter"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/inputNum" />
</android.support.constraint.ConstraintLayout>

Did I make any mistakes in the code structure? Please do tell what's wrong... Thank you!

P.S: Here is the log 05-22 20:33:40.210 26115-26147/com.google.android.googlequicksearchbox:search I/MicroDetector: Keeping mic open: false 05-22 20:33:40.210 26115-26147/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #onError(false) 05-22 20:33:41.127 1809-19804/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 39117558 , only wrote 38921002 05-22 20:33:42.129 1849-1849/? W/adbd: timeout expired while flushing socket, closing 05-22 20:33:45.213 26115-26147/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #startMicroDetector [speakerMode: 0] 05-22 20:33:45.214 26115-26147/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 393244, bug: 0]: errorCode: 393244, engine: 0 05-22 20:33:45.214 26115-26147/com.google.android.googlequicksearchbox:search I/MicroDetector: Keeping mic open: false 05-22 20:33:45.214 26115-26147/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: #onError(false) 05-22 20:33:47.784 2114-2995/system_process I/ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.home.numbershape/.MainActivity bnds=[237,1011][439,1264]} from uid 10097 05-22 20:33:47.788 1809-6570/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 38921091 , only wrote 38921002 05-22 20:33:47.794 2114-2142/system_process E/system_server: Invalid ID 0x00000000. 05-22 20:33:47.800 2114-3193/system_process W/InputReader: Device has associated, but no associated display id. 05-22 20:33:47.803 2114-2114/system_process W/ActivityManager: Unable to start service Intent { act=android.service.appprediction.AppPredictionService cmp=com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiPredictionService } U=0: not found 05-22 20:33:47.803 2114-2114/system_process W/RemoteAppPredictionService: could not bind to Intent { act=android.service.appprediction.AppPredictionService cmp=com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiPredictionService } using flags 67108865 05-22 20:33:47.800 2114-3193/system_process I/chatty: uid=1000(system) Binder:2114_F identical 8 lines 05-22 20:33:47.800 2114-3193/system_process W/InputReader: Device has associated, but no associated display id. 05-22 20:33:47.807 1819-3537/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496 05-22 20:33:47.811 1803-1803/? D/Zygote: Forked child process 26805 05-22 20:33:47.815 2114-2148/system_process I/ActivityManager: Start proc 26805:com.example.home.numbershape/u0a142 for activity {com.example.home.numbershape/com.example.home.numbershape.MainActivity} 05-22 20:33:47.833 26805-26805/? I/ome.numbershap: Not late-enabling -Xcheck:jni (already on) 05-22 20:33:47.845 26805-26805/? E/ome.numbershap: Unknown bits set in runtime_flags: 0x8000 05-22 20:33:47.846 26805-26805/? W/ome.numbershap: Unexpected CPU variant for X86 using defaults: x86 05-22 20:33:47.856 2114-2995/system_process W/InputReader: Device has associated, but no associated display id. 05-22 20:33:47.861 2114-2995/system_process I/chatty: uid=1000(system) Binder:2114_9 identical 28 lines 05-22 20:33:47.861 2114-2995/system_process W/InputReader: Device has associated, but no associated display id. 05-22 20:33:47.909 26805-26805/? I/ome.numbershap: The ClassLoaderContext is a special shared library. 05-22 20:33:47.940 2114-2142/system_process W/InputReader: Device has associated, but no associated display id. 05-22 20:33:47.940 2114-2142/system_process I/chatty: uid=1000(system) android.anim identical 8 lines 05-22 20:33:47.940 2114-2142/system_process W/InputReader: Device has associated, but no associated display id. 05-22 20:33:47.958 1819-3537/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496 05-22 20:33:48.000 26805-26805/? W/ome.numbershap: JIT profile information will not be recorded: profile file does not exits. 05-22 20:33:48.002 26805-26805/? I/chatty: uid=10142(com.example.home.numbershape) identical 9 lines 05-22 20:33:48.002 26805-26805/? W/ome.numbershap: JIT profile information will not be recorded: profile file does not exits. 05-22 20:33:48.007 26805-26805/? I/InstantRun: starting instant run server: is main process 05-22 20:33:48.030 1845-2658/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property 05-22 20:33:48.032 1845-2658/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property 05-22 20:33:48.046 26805-26805/? W/RenderThread: type=1400 audit(0.0:189): avc: denied { write } for name="property_service" dev="tmpfs" ino=7420 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.example.home.numbershape 05-22 20:33:48.052 26805-26828/? D/libEGL: Emulator has host GPU support, qemu.gles is set to 1. 05-22 20:33:48.055 26805-26828/? W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied) 05-22 20:33:48.072 26805-26828/? D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so 05-22 20:33:48.073 26805-26828/? D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so 05-22 20:33:48.077 26805-26828/? D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so 05-22 20:33:48.237 26805-26805/? W/ome.numbershap: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) 05-22 20:33:48.237 26805-26805/? W/ome.numbershap: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) 05-22 20:33:48.264 1820-2018/? W/EmuHWC2: validate: layer 760 CompositionType 1, fallback 05-22 20:33:48.309 1820-2018/? W/EmuHWC2: No layers, exit, buffer 0xf2212d20 05-22 20:33:48.310 1820-2018/? W/EmuHWC2: validate: layer 760 CompositionType 1, fallback 05-22 20:33:48.319 1820-2018/? W/EmuHWC2: No layers, exit, buffer 0xf2213260 05-22 20:33:48.330 1820-2018/? W/EmuHWC2: validate: layer 760 CompositionType 1, fallback 05-22 20:33:48.334 1820-2018/? W/EmuHWC2: No layers, exit, buffer 0xf2212c60 05-22 20:33:48.350 1820-2018/? W/EmuHWC2: validate: layer 760 CompositionType 1, fallback 05-22 20:33:48.354 1820-2018/? W/EmuHWC2: No layers, exit, buffer 0xf2212d20 05-22 20:33:48.360 26805-26826/? D/HostConnection: HostConnection::get() New Host Connection established 0xe1150190, tid 26826 05-22 20:33:48.370 1820-2018/? W/EmuHWC2: validate: layer 760 CompositionType 1, fallback 05-22 20:33:48.371 26805-26826/? D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2 05-22 20:33:48.373 26805-26826/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 05-22 20:33:48.377 26805-26826/? D/EGL_emulation: eglCreateContext: 0xe111a180: maj 2 min 0 rcv 2 05-22 20:33:48.377 1820-2018/? W/EmuHWC2: No layers, exit, buffer 0xf2213260 05-22 20:33:48.391 1820-2018/? W/EmuHWC2: validate: layer 760 CompositionType 1, fallback 05-22 20:33:48.395 1820-2018/? W/EmuHWC2: No layers, exit, buffer 0xf2212c60 05-22 20:33:48.413 26805-26826/? D/EGL_emulation: eglMakeCurrent: 0xe111a180: ver 2 0 (tinfo 0xe110f190) 05-22 20:33:48.423 1819-3537/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496 05-22 20:33:48.432 1704-1704/? I/hwservicemanager: getTransport: Cannot find entry android.hardware.graphics.mapper@3.0::IMapper/default in either framework or device manifest. 05-22 20:33:48.432 26805-26826/? W/Gralloc3: mapper 3.x is not supported 05-22 20:33:48.433 26805-26826/? D/HostConnection: createUnique: call 05-22 20:33:48.434 26805-26826/? D/HostConnection: HostConnection::get() New Host Connection established 0xe1150460, tid 26826 05-22 20:33:48.434 26805-26826/? D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2 05-22 20:33:48.434 26805-26826/? D/eglCodecCommon: allocate: Ask for block of size 0x1000 05-22 20:33:48.434 26805-26826/? D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ffff4000 size 0x2000 05-22 20:33:48.441 1819-3537/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496 05-22 20:33:48.449 1845-1845/? E/Layer: [Surface(name=AppWindowToken{a8a09ab token=Token{2606ffa ActivityRecord{af85225 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t5}}})/@0x7f50a1a - animation-leash#0] No local sync point found 05-22 20:33:48.449 1845-1845/? E/Layer: [Surface(name=AppWindowToken{a8a09ab token=Token{2606ffa ActivityRecord{af85225 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t5}}})/@0x7f50a1a - animation-leash#0] No local sync point found 05-22 20:33:48.449 1845-1845/? E/Layer: [Surface(name=AppWindowToken{484bd5c token=Token{e25cfcf ActivityRecord{5bca82e u0 com.example.home.numbershape/.MainActivity t129}}})/@0x7862019 - animation-leash#0] No local sync point found 05-22 20:33:48.450 1845-1845/? E/Layer: [Surface(name=AppWindowToken{484bd5c token=Token{e25cfcf ActivityRecord{5bca82e u0 com.example.home.numbershape/.MainActivity t129}}})/@0x7862019 - animation-leash#0] No local sync point found 05-22 20:33:48.453 26805-26826/? D/EGL_emulation: eglMakeCurrent: 0xe111a180: ver 2 0 (tinfo 0xe110f190) 05-22 20:33:48.458 1819-3537/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 8298496 05-22 20:33:48.465 1845-1845/? E/Layer: [Surface(name=AppWindowToken{a8a09ab token=Token{2606ffa ActivityRecord{af85225 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t5}}})/@0x7f50a1a - animation-leash#0] No local sync point found 05-22 20:33:48.465 1845-1845/? E/Layer: [Surface(name=AppWindowToken{484bd5c token=Token{e25cfcf ActivityRecord{5bca82e u0 com.example.home.numbershape/.MainActivity t129}}})/@0x7862019 - animation-leash#0] No local sync point found 05-22 20:33:48.631 26115-26145/com.google.android.googlequicksearchbox:search D/EGL_emulation: eglMakeCurrent: 0xe926a640: ver 2 0 (tinfo 0xe925dcc0) 05-22 20:33:48.638 2766-3313/com.google.android.apps.nexuslauncher D/EGL_emulation: eglMakeCurrent: 0xf447fd00: ver 2 0 (tinfo 0xc94f6330) 05-22 20:33:48.719 26805-26805/? I/AssistStructure: Flattened final assist data: 1856 bytes, containing 1 windows, 9 views 05-22 20:33:48.729 2322-2322/com.google.android.gms.persistent W/lfu: Pending fill request while another request in the same session was triggered. [CONTEXT service_id=177 ] 05-22 20:33:48.729 2114-2146/system_process I/ActivityTaskManager: Displayed com.example.home.numbershape/.MainActivity: +918ms 05-22 20:33:48.760 2114-2139/system_process D/AutofillUI: destroySaveUiUiThread(): already destroyed 05-22 20:33:48.771 2114-3193/system_process I/ActivityManager: Killing 26115:com.google.android.googlequicksearchbox:search/u0a109 (adj 900): remove task 05-22 20:33:48.775 2114-2149/system_process I/libprocessgroup: Successfully killed process cgroup uid 10109 pid 26115 in 0ms 05-22 20:33:48.789 2322-2322/com.google.android.gms.persistent E/ActivityThread: Service com.google.android.gms.autofill.service.AutofillService has leaked IntentReceiver com.google.android.gms.autofill.smsretriever.TracingSmsBroadcastReceiver@b66a7f6 that was originally registered here. Are you missing a call to unregisterReceiver()? android.app.IntentReceiverLeaked: Service com.google.android.gms.autofill.service.AutofillService has leaked IntentReceiver com.google.android.gms.autofill.smsretriever.TracingSmsBroadcastReceiver@b66a7f6 that was originally registered here. Are you missing a call to unregisterReceiver()? at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1588) at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1368) at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1515) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1488) at android.app.ContextImpl.registerReceiver(ContextImpl.java:1476) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:627) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:627) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:627) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:627) at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:627) at lkl.<init>(:com.google.android.gms@200414022@20.04.14 (040700-294335909):5) at ljc.<init>(:com.google.android.gms@200414022@20.04.14 (040700-294335909):1) at kxb.a(:com.google.android.gms@200414022@20.04.14 (040700-294335909):10) at bzlo.a(:com.google.android.gms@200414022@20.04.14 (040700-294335909):5) at kxj.a(:com.google.android.gms@200414022@20.04.14 (040700-294335909):2) at bzlo.a(:com.google.android.gms@200414022@20.04.14 (040700-294335909):5) at kvm.b(:com.google.android.gms@200414022@20.04.14 (040700-294335909):0) at lfu.onFillRequest(:com.google.android.gms@200414022@20.04.14 (040700-294335909):70) at android.service.autofill.-$$Lambda$I0gCKFrBTO70VZfSZTq2fj-wyG8.accept(Unknown Source:8) at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:300) at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:195) at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:86) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) 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) 05-22 20:33:48.798 1845-1845/? W/SurfaceFlinger: couldn't log to binary event log: overflow. 05-22 20:33:48.835 2114-2574/system_process D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ TRACK_DEFAULT id=28, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10109] ], android.os.BinderProxy@86ccea2) 05-22 20:33:48.835 2114-2574/system_process D/ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=29, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10109] ], android.os.BinderProxy@958733) 05-22 20:33:48.836 2114-2281/system_process D/ConnectivityService: releasing NetworkRequest [ TRACK_DEFAULT id=28, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10109] ] (release request) 05-22 20:33:48.838 1803-1803/? I/Zygote: Process 26115 exited due to signal 9 (Killed) 05-22 20:33:48.839 2114-2238/system_process W/InputDispatcher: channel '3c2ce45 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 05-22 20:33:48.839 2114-2238/system_process E/InputDispatcher: channel '3c2ce45 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 05-22 20:33:48.840 2114-2995/system_process I/WindowManager: WIN DEATH: Window{3c2ce45 u0 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity} 05-22 20:33:48.840 2114-2995/system_process W/InputDispatcher: Attempted to unregister already unregistered input channel '3c2ce45 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity (server)' 05-22 20:33:48.845 2114-3769/system_process W/ActivityManager: Scheduling restart of crashed service com.google.android.googlequicksearchbox/com.google.android.apps.gsa.nowoverlayservice.DrawerOverlayService in 1000ms 05-22 20:33:48.847 2114-2141/system_process W/ActivityManager: setHasOverlayUi called on unknown pid: 26115 05-22 20:33:50.906 1809-19804/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 39195122 , only wrote 39058490 05-22 20:33:53.697 1809-6570/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 39058499 , only wrote 39058490 05-22 20:33:56.845 1809-19804/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 39334346 , only wrote 39197300 05-22 20:34:00.004 2340-2340/com.android.systemui D/KeyguardClockSwitch: Updating clock: 834 05-22 20:34:03.821 2114-2146/system_process E/memtrack: Couldn't load memtrack module 05-22 20:34:03.821 2114-2146/system_process W/android.os.Debug: failed to get memory consumption info: -1 05-22 20:34:04.463 1968-1968/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument 05-22 20:34:06.347 1970-1970/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe 05-22 20:34:51.709 2114-2146/system_process E/memtrack: Couldn't load memtrack module 05-22 20:34:51.709 2114-2146/system_process W/android.os.Debug: failed to get memory consumption info: -1 05-22 20:35:00.002 2340-2340/com.android.systemui D/KeyguardClockSwitch: Updating clock: 835 05-22 20:35:02.673 2114-3769/system_process D/WificondControl: Scan result ready event 05-22 20:35:04.524 1968-1968/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument 05-22 20:35:06.403 1970-1970/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe

java
android
android-studio
freeze
asked on Stack Overflow May 22, 2020 by Gabriel Abraham • edited May 22, 2020 by Gabriel Abraham

1 Answer

-1

You have not referenced your button in your Java code. Try Adding this code in the onCreate method of your Main Activity

Button Sbutton = findViewById(R.id.submitButton);
answered on Stack Overflow May 22, 2020 by AMAN KUMAR • edited May 23, 2020 by double-beep

User contributions licensed under CC BY-SA 3.0