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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:36:37+00:00 2026-06-17T08:36:37+00:00

Back again with yet another newbie error i cant seem to get my head

  • 0

Back again with yet another newbie error i cant seem to get my head around,

I want to simplay start an intent to a new class, I have done a number of these on my app with no issue. My manaifest seems fine (no spelling errors or lower/upper case letters where there shouldnt be) and the class name is spelt correctly etc.

Heres the logcat error:

01-13 02:23:21.816: E/AndroidRuntime(283): FATAL EXCEPTION: main
01-13 02:23:21.816: E/AndroidRuntime(283): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.flybase2/com.example.flybase2.search}: java.lang.NullPointerException
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.os.Looper.loop(Looper.java:123)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.ActivityThread.main(ActivityThread.java:4627)
01-13 02:23:21.816: E/AndroidRuntime(283):  at java.lang.reflect.Method.invokeNative(Native Method)
01-13 02:23:21.816: E/AndroidRuntime(283):  at java.lang.reflect.Method.invoke(Method.java:521)
01-13 02:23:21.816: E/AndroidRuntime(283):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-13 02:23:21.816: E/AndroidRuntime(283):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-13 02:23:21.816: E/AndroidRuntime(283):  at dalvik.system.NativeStart.main(Native Method)
01-13 02:23:21.816: E/AndroidRuntime(283): Caused by: java.lang.NullPointerException
01-13 02:23:21.816: E/AndroidRuntime(283):  at com.example.flybase2.search.onCreate(search.java:27)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-13 02:23:21.816: E/AndroidRuntime(283):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flybase2"
android:versionCode="1"
android:versionName="1.0" >

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

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

         <activity
        android:name=".search"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.flybase2.search" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

     <activity
        android:name=".add"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.flybase2.add" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

      <activity
        android:name=".view"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.flybase2.view" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>



</application>

</manifest>

My class im loading the intent from:

        case (R.id.btnSearch):

    Intent Search = new Intent("com.example.flybase2.search");
    startActivity(Search);

    break;
}

And the ‘.search’ class file which is meant to be opened from the intent.

package com.example.flybase2;

import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

public class search extends ListActivity implements OnClickListener {


Button searchButton;
EditText searchName;
ListView searchedListResults;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

searchButton = (Button) findViewById(R.id.btnSearch);   
searchName = (EditText) findViewById(R.id.inputName);   

searchButton.setOnClickListener(this);

}
@Override
public void onClick(View clickedSearchButton) {

String searchedName = searchName.getText().toString();

searchedListResults = (ListView)findViewById(android.R.id.list);
DBHandler DBsearchRef = new DBHandler(this, null, null);

DBHandler search = new DBHandler(this, null, null);

search.open();
Cursor cursor = search.searchOnName(searchedName);

startManagingCursor(cursor);

@SuppressWarnings("static-access")
String [] from = new String [] {DBsearchRef.KEY_NAME, DBsearchRef.KEY_TEL,  DBsearchRef.KEY_EMAIL, DBsearchRef.KEY_COMMENTS};
int [] to = new int [] {R.id.txtNameList, R.id.txtTelList, R.id.txtEmailList, R.id.txtCommentsList};

@SuppressWarnings("deprecation")
SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this, R.layout.search, cursor, from, to);
searchedListResults.setAdapter(cursorAdapter);




}
  • 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-17T08:36:38+00:00Added an answer on June 17, 2026 at 8:36 am

    You intent is launching the activity just fine. The null pointer exception comes on this line

    searchButton.setOnClickListener(this);
    

    You have not set a content view for the activity, so the findViewById returns null.

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

Sidebar

Related Questions

Back again with yet another DirectSound question, this one regarding the ways DirectSound Buffers
Back again with a javascript question within sharepoint. I would like to hide a
back again with some more SQLAlchemy shenanigans. Let me step through this. My table
I am trying to convert a Date to String and then back again to
I am back with a problem again (please cooperate with my silly questions, i
I'm back. Again. :3 Right now, I'm working on my RPG project (just for
Okay hello everyone! I have another problem again.. I'm getting an unhandled exception. I
Apologies for posting yet another Java jar question. I did have a look at
its me... yet again! Ive got these class, public class PrankTargetArgumentViewModel { public PrankTarget
Back in MVC3, I had a custom ControllerFactory which would use my own container

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.