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

  • SEARCH
  • Home
  • 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 7767637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:43:35+00:00 2026-06-01T15:43:35+00:00

I am new at android. I followed tutorials from http://www.youtube.com/watch?v=1JyC_xv20yE There is no error

  • 0

I am new at android. I followed tutorials from http://www.youtube.com/watch?v=1JyC_xv20yE
There is no error in program. But emulator gives “the application stopped unexpectedly”

log file as

04-11 19:50:14.295: D/AndroidRuntime(338): Shutting down VM
04-11 19:50:14.295: W/dalvikvm(338): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-11 19:50:14.315: E/AndroidRuntime(338): FATAL EXCEPTION: main
04-11 19:50:14.315: E/AndroidRuntime(338): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sql/com.sql.SQLiteExample}: java.lang.ClassCastException: com.sql.SQLiteExample
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.os.Looper.loop(Looper.java:123)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.ActivityThread.main(ActivityThread.java:3683)
04-11 19:50:14.315: E/AndroidRuntime(338):  at java.lang.reflect.Method.invokeNative(Native Method)
04-11 19:50:14.315: E/AndroidRuntime(338):  at java.lang.reflect.Method.invoke(Method.java:507)
04-11 19:50:14.315: E/AndroidRuntime(338):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-11 19:50:14.315: E/AndroidRuntime(338):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-11 19:50:14.315: E/AndroidRuntime(338):  at dalvik.system.NativeStart.main(Native Method)
04-11 19:50:14.315: E/AndroidRuntime(338):  at com.sql.SQLiteExample.onCreate(SQLiteExample.java:28)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-11 19:50:14.315: E/AndroidRuntime(338):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-11 19:50:14.315: E/AndroidRuntime(338):  ... 11 more
04-11 19:55:14.435: I/Process(338): Sending signal. PID: 338 SIG: 9
04-11 20:02:38.005: W/dalvikvm(367): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-11 20:02:38.045: E/AndroidRuntime(367): FATAL EXCEPTION: main
04-11 20:02:38.045: E/AndroidRuntime(367): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sql/com.sql.SQLiteExample}: java.lang.ClassCastException: com.sql.SQLiteExample
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.os.Looper.loop(Looper.java:123)
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.app.ActivityThread.main(ActivityThread.java:3683)
04-11 20:02:38.045: E/AndroidRuntime(367):  at java.lang.reflect.Method.invokeNative(Native Method)
04-11 20:02:38.045: E/AndroidRuntime(367):  at java.lang.reflect.Method.invoke(Method.java:507)
04-11 20:02:38.045: E/AndroidRuntime(367):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-11 20:02:38.045: E/AndroidRuntime(367):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-11 20:02:38.045: E/AndroidRuntime(367):  at dalvik.system.NativeStart.main(Native Method)
04-11 20:02:38.045: E/AndroidRuntime(367): Caused by: java.lang.ClassCastException: com.sql.SQLiteExample
04-11 20:02:38.045: E/AndroidRuntime(367):  at com.sql.SQLiteExample.onCreate(SQLiteExample.java:28)
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-11 20:02:38.045: E/AndroidRuntime(367):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-11 20:02:38.045: E/AndroidRuntime(367):  ... 11 more
04-11 20:07:38.165: I/Process(367): Sending signal. PID: 367 SIG: 9

SQLiteexample.java as

package com.sql;

import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class SQLiteExample extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
    Button sqlUpdate,sqlView;
    EditText sqllocation,sqllongi,sqllati;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sqliteexample);
        sqlUpdate = (Button)findViewById(R.id.bsqlupdate);
        sqlView = (Button)findViewById(R.id.bsqlopenview);
        sqllongi = (EditText)findViewById(R.id.longi);
        sqllati = (EditText)findViewById(R.id.lati);
        sqllocation = (EditText)findViewById(R.id.location1);
        sqlView.setOnClickListener((android.view.View.OnClickListener) this);
        sqlUpdate.setOnClickListener((android.view.View.OnClickListener) this);

    }

    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        switch (arg0.getId())
        {
        case R.id.bsqlupdate:
            boolean wrk=true;
            try{
            String location = sqllocation.getText().toString();
            String longi = sqllongi.getText().toString();
            String lati = sqllongi.getText().toString();
            Cornte entry = new Cornte(this);
            entry.open();
            entry.createEntry(location , longi, lati);

            entry.close();
            }catch (Exception e){
                wrk= false;
                String error=e.toString();
                Dialog d=new Dialog(this);
                d.setTitle("NO!!!");
                TextView tv =new TextView(this);
                tv.setText(error);
                d.setContentView(tv);
                d.show(); 

            }finally{
                if(wrk)
                {
                    Dialog d=new Dialog(this);
                    d.setTitle("YUP!!!");
                    TextView tv =new TextView(this);
                    tv.setText("SUCCESS");
                    d.setContentView(tv);
                    d.show();
                }
            }
            break;
        case R.id.bsqlopenview:
            Intent i =new Intent("com.sql.SQLVIEW");
            startActivity(i);

            break;
        }
    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        // TODO Auto-generated method stub

    }
}
  • 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-01T15:43:36+00:00Added an answer on June 1, 2026 at 3:43 pm

    The error is in:

    sqlView.setOnClickListener((android.view.View.OnClickListener) this);
    

    You can see it in your logcat:

    04-11 20:02:38.045: E/AndroidRuntime(367):  at com.sql.SQLiteExample.onCreate(SQLiteExample.java:28)
    

    I’ll explain, first try learning to use the logcat, mostly you should just start at the bottom of the error and search for the lines with your namespace (in this case com.sql.SQLiteExample), now you can see what method made your app crash, in this example: ‘onCreate’ but most important is the file + line number where the error occured!

    ClassCastException means that you want to put an Object into an Object it isn’t…
    School example you got BaseObjects ‘Animal’ which has some ChildObjects ‘Dogg’ & ‘Cat’ but now you are trying to do the following:

    Apple apple = giveMeThatApple();
    Animal a = apple;
    

    Well that won’t work since that ‘apple’ has nothing to do with the Class ‘Animal’… I hope you understand…

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

Sidebar

Related Questions

I followed Google's Map View tutorial from this link http://developer.android.com/resources/tutorials/views/hello-mapview.html I've done the first
So I followed this tutorial from Google: http://developer.android.com/resources/tutorials/opengl/opengl-es20.html The triangle is supposed to rotate
The new Android 2.1 SDK (version 7) has a new class called SignalStrength: http://developer.android.com/reference/android/telephony/SignalStrength.html
I followed this tutorial http://www.androidhive.info/2012/03/android-facebook-connect-tutorial/ to connect Facebook to my Android application. Instead of
I have followed a tutorial over at http://www.yougli.net/android/a-photoshop-like-color-picker-for-your-android-application/ But couldn't find a way of
I'm a bit new to Android developing. I followed the tutorials to set up
I have followed this tutorial ( http://stuffthathappens.com/blog/2008/11/13/android-animation-101/ ) and have a beautiful rotating text
I followed this tutorial http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt4part1 and i have one problem. The geolocation doesn't work
I'm following this tutorial: http://mobile.tutsplus.com/tutorials/android/capture-and-crop-an-image-with-the-device-camera/ I am trying to create a simple activity that
when i am creating new android project from visual studio 2010 it gives the

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.