• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps app error

ionut hanu

Lurker
hi! I try to make an easy app which display sum of 2 number but when i run the app in the virtual manager i receive this error ( first image) why?
 

Attachments

  • 211.PNG
    211.PNG
    85.7 KB · Views: 135
  • 2.PNG
    2.PNG
    61.3 KB · Views: 94
  • 3.PNG
    3.PNG
    38.5 KB · Views: 107
Hi. I moved your thread over to the Application Development forum, which is the place to ask questions about app development.
Please read the following thread, which contains some useful information for beginners, and explains the information needed when asking a question.

https://androidforums.com/threads/please-read-me-before-posting.987318/

Please don't use screenshots for code. Instead paste the code text using [code][/code] tags.
Thanks!
 
Your layout issues are probably due to all the components being placed at the same location on the screen. Can you post your layout XML?
 
Code:
<?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.slimjr.proiectf.MainActivity"
    tools:layout_editor_absoluteY="81dp"
    tools:layout_editor_absoluteX="0dp">

    <EditText
        android:id="@+id/txt1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="X"
        android:inputType="number"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        tools:layout_editor_absoluteY="46dp" />

    <EditText
        android:id="@+id/txt2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="Y"
        android:inputType="number"
        tools:layout_editor_absoluteX="85dp"
        tools:layout_editor_absoluteY="108dp" />

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:eek:nClick="onButtonClick"
        android:text="Suma"
        tools:layout_editor_absoluteX="148dp"
        tools:layout_editor_absoluteY="218dp" />

    <TextView
        android:id="@+id/res"
        android:layout_width="75dp"
        android:layout_height="42dp"
        android:text="rezultat"
        tools:layout_editor_absoluteX="154dp"
        tools:layout_editor_absoluteY="168dp" />

</android.support.constraint.ConstraintLayout>
 
Last edited by a moderator:
Back
Top Bottom