Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8213785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:14:19+00:00 2026-06-07T11:14:19+00:00

a simple android app to calculate tips, i cant figure out this error. the

  • 0

a simple android app to calculate tips, i cant figure out this error. the java code has no errors and the xml has a couple of warnings. ill post both, but when I run it the app immediately quits and says “the application tipConverter (process.com.example.tipconverter) has stopped unexpectedly. please try again.” and i dont know why.

here is the xml:

<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
    android:id="@+id/widget0"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Tip Calculator"/>
    <TextView
        android:id="@+id/widget28"
        android:layout_width="99dp"
        android:layout_height="17dp"
        android:text="Amount of Bill"
        android:layout_x="40dp"
        android:layout_y="32dp"/>
    <TextView
        android:id="@+id/widget29"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Percentage to Tip"
        android:layout_x="40dp"
        android:layout_y="82dp"/>
    <TextView
        android:id="@+id/widget30"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Number of People"
        android:layout_x="40dp"
        android:layout_y="132dp"/>
    <TextView
        android:id="@+id/widget31"
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        android:text="Tip Amout"
        android:layout_x="40dp"
        android:layout_y="262dp"/>
    <TextView
        android:id="@+id/widget32"
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        android:text="Total Per Person"
        android:layout_x="40dp"
        android:layout_y="352dp"/>
    <TextView
        android:id="@+id/widget33"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Total To Pay"
        android:layout_x="40dp"
        android:layout_y="302dp"/>
    <Button
        android:id="@+id/btncalculate"
        android:layout_width="87dp"
        android:layout_height="wrap_content"
        android:text="Calculate"
        android:layout_x="40dp"
        android:layout_y="182dp"/>
    <Button
        android:id="@+id/btnreset"
        android:layout_width="86dp"
        android:layout_height="wrap_content"
        android:text="Reset"
        android:layout_x="140dp"
        android:layout_y="182dp"/>
    <EditText
        android:id="@+id/txtbillamount"
        android:layout_width="wrap_content"
        android:layout_height="35dp"
        android:text="100"
        android:textSize="18sp"
        android:layout_x="200dp"
        android:layout_y="22dp"/>
    <EditText
        android:id="@+id/txtpercentage"
        android:layout_width="51dp"
        android:layout_height="36dp"
        android:text="10"
        android:textSize="18sp"
        android:layout_x="200dp"
        android:layout_y="72dp"/>
    <EditText
        android:id="@+id/txtpeople"
        android:layout_width="wrap_content"
        android:layout_height="39dp"
        android:text="1         "
        android:textSize="18sp"
        android:layout_x="200dp"
        android:layout_y="122dp"/>
    <TextView
        android:id="@+id/txttipamount"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:layout_x="200dp"
        android:layout_y="262dp"/>
    <TextView
        android:id="@+id/txttotal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:layout_x="200dp"
        android:layout_y="302dp"/>
    <TextView
        android:id="@+id/txtperperson"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:layout_x="200dp"
        android:layout_y="352dp"/>

</AbsoluteLayout>

and here is the java

package com.android;

import com.example.tipconverter.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Button;
import android.view.View;

public class tipcalc extends Activity {
    private EditText txtbillamount;
    private EditText txtpeople;
    private EditText txtpercentage;
    private TextView txtperperson;
    private TextView txttipamount;
    private TextView txttotal;
    private Button btncalculate;
    private Button btnreset;
    private double billamount = 0;
    private double percentage = 0;
    private double numofpeople=0;
    private double tipamount = 0;
    private double totaltopay = 0;
    private double perperson = 0;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initControls();
    }

    private void initControls() {
        txtbillamount = (EditText)findViewById(R.id.txtbillamount);
        txtpeople = (EditText)findViewById(R.id.txtpeople);
        txtpercentage = (EditText)findViewById(R.id.txtpercentage);
        txtperperson=(TextView)findViewById(R.id.txtperperson);
        txttipamount=(TextView)findViewById(R.id.txttipamount);
        txttotal=(TextView)findViewById(R.id.txttotal);
        btncalculate = (Button)findViewById(R.id.btncalculate);
        btnreset = (Button)findViewById(R.id.btnreset);
        btncalculate.setOnClickListener(new Button.OnClickListener() { 
            public void onClick (View v)  { 
                calculate(); 
            }
        });

        btnreset.setOnClickListener(new Button.OnClickListener() { 
            public void onClick (View v){ 
                reset(); 
            }
        });
    }

    private void calculate() {
        billamount=Double.parseDouble(txtbillamount.getText().toString());
        percentage=Double.parseDouble(txtpercentage.getText().toString());
        numofpeople=Double.parseDouble(txtpeople.getText().toString());
        tipamount=(billamount*percentage)/100;
        totaltopay=billamount+tipamount;
        perperson=totaltopay/numofpeople;
        txttipamount.setText(Double.toString(tipamount));
        txttotal.setText(Double.toString(totaltopay));
        txtperperson.setText(Double.toString(perperson));
    }

    private void reset() {
        txtbillamount.setText("");
        txtpeople.setText("");
        txtpercentage.setText("");
        txtperperson.setText("");
        txttipamount.setText("");
        txttotal.setText("");
    }
}

any tips or help would be greatly appreciated. thanks!

edit

here is what the logcat prints

07-09 02:49:02.208: D/AndroidRuntime(283): >>>>>>>>>>>>>> AndroidRuntime START     <<<<<<<<<<<<<<
07-09 02:49:02.208: D/AndroidRuntime(283): CheckJNI is ON
07-09 02:49:02.278: D/AndroidRuntime(283): --- registering native functions ---
07-09 02:49:02.598: D/AndroidRuntime(283): Shutting down VM
07-09 02:49:02.598: D/dalvikvm(283): Debugger has detached; object registry had 1 entries
07-09 02:49:02.608: I/AndroidRuntime(283): NOTE: attach of thread 'Binder Thread #3'  failed
07-09 02:49:02.878: D/AndroidRuntime(291): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-09 02:49:02.878: D/AndroidRuntime(291): CheckJNI is ON
07-09 02:49:02.958: D/AndroidRuntime(291): --- registering native functions ---
07-09 02:49:03.267: I/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.tipconverter/com.example.tipconverter }
07-09 02:49:03.277: I/ActivityManager(58): Start proc com.example.tipconverter for activity com.example.tipconverter/com.example.tipconverter: pid=297 uid=10036 gids={}
07-09 02:49:03.317: D/AndroidRuntime(291): Shutting down VM
07-09 02:49:03.317: D/dalvikvm(291): Debugger has detached; object registry had 1 entries
07-09 02:49:03.577: D/AndroidRuntime(297): Shutting down VM
07-09 02:49:03.577: W/dalvikvm(297): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-09 02:49:03.597: I/ARMAssembler(58): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x381c90:0x381d9c] in 289122 ns
07-09 02:49:03.597: E/AndroidRuntime(297): FATAL EXCEPTION: main
07-09 02:49:03.597: E/AndroidRuntime(297): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.tipconverter/com.example.tipconverter}: java.lang.ClassNotFoundException: com.example.tipconverter in loader dalvik.system.PathClassLoader[/data/app/com.example.tipconverter-1.apk]
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-09 02:49:03.597: E/AndroidRuntime(297):  at   android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.os.Looper.loop(Looper.java:123)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.app.ActivityThread.main(ActivityThread.java:4627)
07-09 02:49:03.597: E/AndroidRuntime(297):  at java.lang.reflect.Method.invokeNative(Native Method)
07-09 02:49:03.597: E/AndroidRuntime(297):  at java.lang.reflect.Method.invoke(Method.java:521)
07-09 02:49:03.597: E/AndroidRuntime(297):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-09 02:49:03.597: E/AndroidRuntime(297):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-09 02:49:03.597: E/AndroidRuntime(297):  at dalvik.system.NativeStart.main(Native Method)
07-09 02:49:03.597: E/AndroidRuntime(297): Caused by: java.lang.ClassNotFoundException: com.example.tipconverter in loader dalvik.system.PathClassLoader[/data/app/com.example.tipconverter-1.apk]
07-09 02:49:03.597: E/AndroidRuntime(297):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-09 02:49:03.597: E/AndroidRuntime(297):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-09 02:49:03.597: E/AndroidRuntime(297):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-09 02:49:03.597: E/AndroidRuntime(297):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
07-09 02:49:03.597: E/AndroidRuntime(297):  ... 11 more
07-09 02:49:03.617: W/ActivityManager(58):   Force finishing activity com.example.tipconverter/com.example.tipconverter
07-09 02:49:04.119: W/ActivityManager(58): Activity pause timeout for HistoryRecord{45075650 com.example.tipconverter/com.example.tipconverter}
07-09 02:49:14.293: W/ActivityManager(58): Activity destroy timeout for     HistoryRecord{45075650 com.example.tipconverter/com.example.tipconverter}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:14:21+00:00Added an answer on June 7, 2026 at 11:14 am

    You can check the log:

    [2012-07-08 18:05:33 - tipConverter] Starting activity    com.example.tipconverter.MainActivity on device emulator-5554
    

    It’s looking for MainActivity.java as defined in the Android manifest file. You probably have renamed it to tipcalc.java. You need to do the adjustment in the Android manifest file.

    UPDATE:

    It seems like a broken Android project settings. As a result, a bad APK was generated. You can check the .properties and .project files of your Android project. When in doubt, try creating a new project from scratch and compare the differences of the files mentioned. Also make sure that you have the correct target SDK versions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When we create a simple android app, we can find MainActivity.java in src/com.app.main and
A simple android Hello World: MainActivity.java: package com.amaker.ch02.app; import android.app.Activity; import android.os.Bundle; import android.widget.TextView;
Hi Ive written a simple android application with two xml pages, one has an
I have a simple android app that has quite a number of buttons, all
I have developed a very simple Android app where user has to select items
I am trying to create a simple android app in Java but I have
I have a simple android app on the market. I have noticed some error
i am designing a simple android app,which has a check box displayed in the
I have a logic error in a simple android app; I have 3 Buttons
This is my first attempt to create a simple android app using phonegap 1.9.0.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.