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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:48:30+00:00 2026-05-25T12:48:30+00:00

I am going through the 2nd exercise of the android example the notepad app,

  • 0

I am going through the 2nd exercise of the android example the notepad app, I have this a question about the difference between Long and long that was used to define the mRowId.

The exercise is here: http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html

And below is the code piece that I am having problem with:

public class NoteEdit extends Activity {

private Long mRowId; 
private EditText mTitleText;
private EditText mBodyText; 

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    setContentView(R.layout.note_edit);
    setTitle(R.string.edit_note);

    mTitleText = (EditText) findViewById(R.id.title);
    mBodyText = (EditText) findViewById(R.id.body);
    Button confirmButton = (Button) findViewById(R.id.confirm);

    mRowId = null;

When I declared mRowId with long, I got an error when I tried to set mRowId to null, the error is “type mismatch”. But if I use Long, the error goes away. Why doesn’t long work?

  • 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-25T12:48:30+00:00Added an answer on May 25, 2026 at 12:48 pm

    Long is a wrapper class around the primitive long. Therefore Long is an object; objects can be null, primitives can not.

    See the Long class documentation.

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

Sidebar

Related Questions

Going through the microsoft authentication tutorial listed here they have you create a master
Going through Lynda's 2010 tutorial on rails and have been stuck on migration for
Going through a tutorial for android (related to multithreading, loopers and handlers), i came
I am going through the Learn Python the Hard Way, 2nd Edition book, and
This is going to sound like a silly question, but I'm still learning C,
Going through my code, I was hoping to remove instances where I do this:
So I'm going through the first chapter of How To Design Programs 2nd Edition.
Going through classic data structures and have stopped on linked lists.Just implemented a circular
I'm going through Learn Python the Hard Way 2nd Edition and I've just done
Well this is going to sound like a lame question, I know. This is

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.