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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:51:55+00:00 2026-05-31T17:51:55+00:00

Thsi is my code: EditText editCategoryName, editBrandName; private ArrayAdapter<String> myAdapter1, myAdapter2; @Override public void

  • 0

Thsi is my code:

EditText editCategoryName, editBrandName;
    private ArrayAdapter<String> myAdapter1, myAdapter2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//      mylist = new ArrayList<HashMap<String, String>>();
//      mylist2 = new ArrayList<HashMap<String, String>>();
        myList1 = new ArrayList<String>();
        myList2 = new ArrayList<String>();
        editCategoryName = (EditText)findViewById(R.id.editCategoryName);
        editBrandName = (EditText)findViewById(R.id.editBrandName);
        editCategoryName.setText("Google is your friend.", TextView.BufferType.EDITABLE);

<EditText
        android:id="@+id/editCategoryName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="請輸入分類名稱"
        android:singleLine="true" >
    </EditText>

    <TextView
        android:id="@+id/textSpinnerBrand"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:hint="hint" />

    <Spinner
        android:id="@+id/spinnerBrand"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <EditText
        android:id="@+id/editBrandName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="hint"
        android:singleLine="true" >
    </EditText>

The null pointer error shows that in line:

editCategoryName.setText("Google is your friend.", TextView.BufferType.EDITABLE);

I don’t know why. Please help..

  • 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-05-31T17:51:56+00:00Added an answer on May 31, 2026 at 5:51 pm

    After super.onCreate(savedInstanceState);
    this line you forget setContentView(R.layout.<xml file name>)

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

Sidebar

Related Questions

i am retrieving different characters from a string by using thsi function and adding
Thsi does not seem to work: $msg=Your changes have been saved successfully; $view=include('application/view/admin/cms/_slides-current.php'); $return_array=array('success'=>true,
In thsi example: int a[2][2]={{1,2},{3,4}}; int *p=a[0]; cout<<p; cout<<&a[0][0]; Both gives the same output.
I have 2 tables: Categories (int Id, string Title) Works (int categoryId, string WorkTitle,
I have a stored Procedure called Active and the code is: CREATE PROCEDURE dbo.Active
I'm writing an Applet that makes some JSON-RPC calls. I'm using the Google JSON
I have an install script on my website, and when i run it, it
This is a big-picture question... but I also have details on the problem I
I have a need to iterate over all of the tables in my database.
I am working on many workflows for a project I am on. In all

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.