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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:11:06+00:00 2026-06-14T08:11:06+00:00

I am passing row id with the help of intent. The calling method being

  • 0

I am passing row id with the help of intent. The calling method being a custom adapter –

holder.text.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                Toast.makeText(getContext(), "TEXT CLICKED" + pos , Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(context,ReminderModificationActivity.class);
                long longPos = (long)pos;
                intent.putExtra(TasksDBAdapter.KEY_ROWID, pos);
                Log.i(TAG, "row clickd --> " + longPos);
                ((Activity) context).startActivityForResult(intent, ACTIVITY_EDIT);
            }
        });

OnCreate() method of ReminderModificationActivity try to retrieve the data.Code –

protected void onCreate(Bundle savedInstanceState){
        dbHelper = new TasksDBAdapter(this);

        //set current theme
        settingsDBAdapter = new SettingsDBAdapter(this);
        settingsDBAdapter.open();

        setSettingsTheme();
        setContentView(R.layout.reminder_modify);
        mCalendar =  Calendar.getInstance();

        Log.i(getLocalClassName(), "VALUE of Button--->" + findViewById(R.id.SetDateButtonId));
        mDateButton = (Button) findViewById(R.id.SetDateButtonId);
        mTimeButton = (Button) findViewById(R.id.SetTimeButtonId);
        mConfirmButton = (Button) findViewById(R.id.SaveButtonId);
        mTitleText = (EditText) findViewById(R.id.TitleEditTextId);
        mBodyText = (EditText) findViewById(R.id.DescriptionEditTextId);

        mRowId = savedInstanceState != null ? savedInstanceState.getLong(TasksDBAdapter.KEY_ROWID) : null ;
        registerButtonListenersAndSetDefaultText();
        Log.i(TAG, "getIntent-->" + getIntent() + mRowId);
        //code to check what row id have been passed
        if(getIntent() != null) { 
            ---->>>MAIN CODE
            Log.i(TAG, "mRowId in getintent-->" +  mRowId + "row id passed-->" +  getIntent().getLongExtra(TasksDBAdapter.KEY_ROWID, -1));
            mRowId =  getIntent().getLongExtra(TasksDBAdapter.KEY_ROWID, -1);
            // Do stuff with the row id here
            if(mRowId != -1){
                //code if RowId valid

            }
        }

        super.onCreate(savedInstanceState);
        Log.i(TAG, "mROwId in onCreate ReminderNotification again-->" + mRowId);    
    }

line marked as MAIN CODE captures the intent data but Log.i gives value of

getIntent().getLongExtra(TasksDBAdapter.KEY_ROWID, -1))

as -1.Can sumone please help me out on this.Thanks in advance,Ray

  • 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-14T08:11:06+00:00Added an answer on June 14, 2026 at 8:11 am

    Seeing as you cast pos to longPos, you should be using longPos in your intent extra, but you use pos.

    if you were to change your code to:

            Intent intent = new Intent(context,ReminderModificationActivity.class);
            long longPos = (long)pos;
            intent.putExtra(TasksDBAdapter.KEY_ROWID, longPos); //<< changed to longPos
    

    It should work

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

Sidebar

Related Questions

I am currently passing in the TinyMCE source as a dependency, and then calling
I am trying to call Action method passing a single parameter. The method (Accepts
I am passing 20+ arguments of different types to method. There should be some
Disclaimer: I'm new to Web Development So Far: I've been passing primary key data
I have a ListView with a Custom Adapter, and I need to access the
I need help in parsing a very long text file which looks like: NAME
I'm trying to get fastercsv setup so that rather than parsing each row, it
Passing User defined argument to RPM is possible while installing?. for example: ~>rpm -i
passing post data using cURL requires that the name of the input. However, I
Passing in an Expression to a Linq query behaves differently depending on syntax used,

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.