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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:55:18+00:00 2026-05-27T14:55:18+00:00

There is a mysterious error at the line ee.add(new BasicNameValuePair(uid,demo)); Eclipse says: Multiple markers

  • 0

There is a mysterious error at the line ee.add(new BasicNameValuePair("uid","demo"));

Eclipse says:

Multiple markers at this line
– Syntax error on token “add”, = expected after this token
– Syntax error on token(s), misplaced construct(s)

package com.test;
import java.util.*;
import org.apache.http.*;
import android.app.Activity;
import android.os.Bundle;

public class HttpMysqlActivity extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    ArrayList<NameValuePair> ee = new ArrayList<NameValuePair>();
    ee.add(new BasicNameValuePair("uid","demo"));//error occurs here
}

I don’t know what the problem is, because ArrayList do have the method add(), and I saw many people (e.g. Link a tutorial of Connecting to MySQL database) code like this. That’s why it is mysterious.

Can anybody tell me why did Eclipse throw the error and how to fix it?

  • 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-27T14:55:19+00:00Added an answer on May 27, 2026 at 2:55 pm

    You’re trying to call a method in the main class body. All you can have there is declarations. Put the ee.add() call inside the onCreate (or another method) and it will work.

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

Sidebar

Related Questions

There is this SQL Statement SELECT t1.Name ,Count(t2.SubID) Totals -- I don't know how
there is an array in c# string[] arr = new string[] {1,A,D,3,5,AF,34,TU,E,OP,4}; so how
In my django project there are some mysterious (at least for me as a
I can't figure out WHY there is a mysterious space appearing on the live
My code is identical to this question I asked earlier so there's no point
There's some mysterious padding between two images while running in IE8 and Quirks Mode
I am having this kind of mysterious issue here. I am currently using Entity
All of a sudden, I'm getting this error: Could not load file or assembly
A kind of stupid error, but this happened when I wanted to call client
I'm tracking a mysterious problem in my code. This bug happens within an event

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.