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 8507553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:54:17+00:00 2026-06-11T02:54:17+00:00

i have download some sample program in some sites and tried to execute the

  • 0

i have download some sample program in some sites and tried to execute the program.that time i have class not found Exception.i am tried to solve the error in many ways . but i cant get the solution.

    public class DataBaseDemoActivity extends Activity {
   /** Called when the activity is first created. */
SQLiteDatabase db;
Button btnInsert;

     @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    btnInsert=(Button)findViewById(R.id.button1);

    try{

    db=openOrCreateDatabase("StudentDB",SQLiteDatabase.CREATE_IF_NECESSARY,null);

    db.execSQL("Create Table Temp(id integer,name text)");

    }catch(SQLException e)
    {

    }

    btnInsert.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {


            EditText eid=(EditText) findViewById(R.id.edit1);
            EditText ename=(EditText)findViewById(R.id.edit2);

            ContentValues values=new ContentValues();
            values.put("id", eid.getText().toString());
            values.put("name", ename.getText().toString());
            if((db.insert("temp", null, values))!=-1)
            {
Toast.makeText(DataBaseDemoActivity.this, "Record       Successfully Inserted", 2000).show();
            }
            else
            {
Toast.makeText(DataBaseDemoActivity.this, "Insert Error", 2000).show();
            }
            eid.setText("");
            ename.setText("");

            Cursor c=db.rawQuery("SELECT * FROM temp",null);

            c.moveToFirst();
            while(!c.isAfterLast())
            {
           Toast.makeText(  DataBaseDemoActivity.this,c.getString(0)+ " "+c.getString(1), 1000).show();
                c.moveToNext();
            }
            c.close();
        }
    });
   }

   @Override
    protected void onStop() {

    db.close();
    super.onStop();
    }

    }

logcat:

     09-08 11:15:09.841: E/AndroidRuntime(932): FATAL EXCEPTION: main
     09-08 11:15:09.841: E/AndroidRuntime(932): java.lang.RuntimeException: Unable to    instantiate activity                        
   ComponentInfo{com.example.databasedemo/com.example.databasedemo.MainActivity}:                                  java.lang.ClassNotFoundException: com.example.databasedemo.MainActivity
     09-0 8 11:15:09.841: E/AndroidRuntime(932):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
      09-08 11:15:09.841: E/AndroidRuntime(932):    at android.app.ActivityThread.access$600(ActivityThread.java:130)
      09-08 11:15:09.841: E/AndroidRuntime(932):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at android.os.Handler.dispatchMessage(Handler.java:99)
      09-08 11:15:09.841: E/AndroidRuntime(932):    at android.os.Looper.loop(Looper.java:137)
      09-08 11:15:09.841: E/AndroidRuntime(932):    at android.app.ActivityThread.main(ActivityThread.java:4745)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at java.lang.reflect.Method.invokeNative(Native Method)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at java.lang.reflect.Method.invoke(Method.java:511)
       09-08 11:15:09.841: E/AndroidRuntime(932):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    09-08 11:15:09.841: E/AndroidRuntime(932):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    09-08 11:15:09.841: E/AndroidRuntime(932):  at dalvik.system.NativeStart.main(Native Method)
    09-08 11:15:09.841: E/AndroidRuntime(932): Caused by: java.lang.ClassNotFoundException: com.example.databasedemo.MainActivity
     09-08 11:15:09.841: E/AndroidRuntime(932):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
     09-08 11:15:09.841: E/AndroidRuntime(932):     at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
      09-08 11:15:09.841: E/AndroidRuntime(932):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
      09-08 11:15:09.841: E/AndroidRuntime(932):    ... 11 more

MAIN.XML:

 <?xml version="1.0" encoding="UTF-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" 
  android:layout_width="fill_parent"
 android:layout_height="fill_parent">
 <TextView 
     android:layout_width="fill_parent"
      android:layout_height="wrap_content"
       android:text="@string/hello"/>
 <TextView 
android:id="@+id/textView1" 
android:textAppearance="?android:attr/textAppearanceMedium"
 android:layout_height="wrap_content" 
 android:layout_width="wrap_content" 
 android:text="@string/si" 
 android:layout_marginTop="20dp"/>
 <EditText 
     android:id="@+id/edit1"
      android:layout_height="wrap_content"
       android:layout_width="match_parent" 
       android:inputType="number" 
       android:hint="@string/esi"
        >

        <requestFocus android:layout_width="wrap_content" />

        </EditText>
        <TextView 
            android:id="@+id/textView2" 
            android:textAppearance="?android:attr/textAppearanceMedium" 
            android:layout_height="wrap_content"
             android:layout_width="wrap_content"
              android:text="@string/sn"/>
        <EditText 
            android:id="@+id/edit2"
             android:layout_height="wrap_content"
              android:layout_width="match_parent" 
              android:hint="@string/esn"/>

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/ir" />

   </LinearLayout>

MANIFEST.XML:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.databasedemo"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

Thanks in advance

  • 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-11T02:54:19+00:00Added an answer on June 11, 2026 at 2:54 am
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.databasedemo"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />
    
    <application
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name"
         android:theme="@style/AppTheme" >
         <activity
             android:name=".DataBaseDemoActivity"
             android:label="@string/title_activity_main" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
    
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
     </application>
    

    Please replace

    android:name=".MainActivity"
    

    to

    android:name=".DataBaseDemoActivity"
    

    I have write the solution above Please find it..

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

Sidebar

Related Questions

I have an HTML page that contains some filenames that i want to download
I have programmed a class that get file with creating some parallel downloads. I
I have windows xp, I have found some python libraries that only work for
I have to download some data from external source but I have to submit
I have some download implementation which allows me to export all data from a
I have an Observable and an Observer . The observable does download some stuff
I am using ASP.NET2.0. I have created a download form with some input fields
I have written some code in JSP to download .docx files which is hosted
I have a thread that downloads some images from internet using different proxies. Sometimes
I have an app that downloads some documents from a server and saves them

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.