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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:12:21+00:00 2026-06-15T00:12:21+00:00

I made an app for tablets that is working just fine on android 3.2.

  • 0

I made an app for tablets that is working just fine on android 3.2. Now I am trying to make it work on android 4+ but somehow a tiny part of the code is not working. I am a beginner so I just can´t figure out what isn´t working since the code was taken from an example some time ago.

The part of the code that is crashing is just an text box where you can write whatever you want based on an spinner where you select what field from the database you wanna filter from. It works flawlessly on 3.2 (and the same piece of code is working in some other spinners I have on another fragments on both versions of android).

First here we go with the logcat:

11-12 18:33:00.428: E/AndroidRuntime(8140): FATAL EXCEPTION: main
11-12 18:33:00.428: E/AndroidRuntime(8140): java.lang.NullPointerException
11-12 18:33:00.428: E/AndroidRuntime(8140):     at dvgvsc.vscdvg.Fragmentsearchlist.ifacesearch(Fragmentsearchlist.java:159)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at dvgvsc.vscdvg.Fragmentsearchlist.onPrepareOptionsMenu(Fragmentsearchlist.java:103)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.FragmentManagerImpl.dispatchPrepareOptionsMenu(FragmentManager.java:1865)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.Activity.onPreparePanel(Activity.java:2463)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:438)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:761)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.Activity.invalidateOptionsMenu(Activity.java:2552)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.FragmentManagerImpl.invalidateOptionsMenu(FragmentManager.java:1914)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.Fragment.setHasOptionsMenu(Fragment.java:898)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at dvgvsc.vscdvg.Fragmentsearchlist.onCreateView(Fragmentsearchlist.java:47)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at dvgvsc.vscdvg.OrdenesFragment.onCreateView(OrdenesFragment.java:65)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:828)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.BackStackRecord.run(BackStackRecord.java:622)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.FragmentManagerImpl$1.run(FragmentManager.java:426)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.os.Handler.handleCallback(Handler.java:605)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.os.Looper.loop(Looper.java:137)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at android.app.ActivityThread.main(ActivityThread.java:4514)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at java.lang.reflect.Method.invokeNative(Native Method)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at java.lang.reflect.Method.invoke(Method.java:511)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
11-12 18:33:00.428: E/AndroidRuntime(8140):     at dalvik.system.NativeStart.main(Native Method)

And here is the piece of code that is crashing ((Line: text_search.addTextChangedListener(new TextWatcher() { ))

private final void ifacesearch() {


        /** search box that is used on the searches, using a listerner which will move the cursor based on the user imput. */

        /*EditText text_search = (EditText)getActivity().findViewById(R.id.text_search);
        text_search.addTextChangedListener(new TextWatcher() {
            public void afterTextChanged(Editable text) {
                if (text.length() > 0) {
                    adapter.changeCursor(vscdvgActivity._db.defcursor(TABLA, SEARCH_FILTER, text.toString()));
                }else{
                    adapter.changeCursor(vscdvgActivity._db.defcursor(TABLA, null, null));
                }
            }
            public void beforeTextChanged(CharSequence text, int start, int before, int count) {                    
            }
            public void onTextChanged(CharSequence text, int start, int before, int count) {
            }
        });*/



        /** add to the spinner the db fields /*

        /*Spinner spinner_filter = (Spinner)getActivity().findViewById(R.id.spinner_filter);
        ArrayAdapter<String> spinner_adapter = new ArrayAdapter<String>(
                getActivity(),
                android.R.layout.simple_spinner_dropdown_item,
                COLUMN_FILTER[1]);
        spinner_filter.setAdapter(spinner_adapter);
        spinner_filter.setOnItemSelectedListener(new OnItemSelectedListener() {
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
                SEARCH_FILTER = COLUMN_FILTER[0][position];
            }
            public void onNothingSelected(AdapterView<?> arg0) {

            }
        });*/

Any ideas what could be possibily crashing?

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-15T00:12:22+00:00Added an answer on June 15, 2026 at 12:12 am

    Null pointer exception means that something wasn’t initialized. In this case, I strongly suspect it is text_search. Try logging it out with a Log.d('TAG',text_search), see if it is in fact null. I suspect what is happening is that you either have a typo in the name of the file in the line above EditText text_search = (EditText)getActivity().findViewById(R.id.text_search);, or you never inflated the layout.

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

Sidebar

Related Questions

I'm developing an app that we will put on Android tablets on be used
Ive made an app, and published it now. I'm facing a weird problem where
I have made an app that gets an array of addresses from a web
I have made an app that implements the iPhone's camera. When the user finishes
I made a cross-platform/browser compatible app, but there is one problem. The browser on
I have an android app that maintains a local SQLite database of different geographic
I made code that download APK from ftp, and I`m trying to install it
I have this nice android app made up and was going to add in
I made a copy of a DB that is used for a web app
I am developing an Android app for tablets and not using the compatibility library.

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.