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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:24:41+00:00 2026-06-16T02:24:41+00:00

I want remove item in array list select location My code is List<String> historylist

  • 0

I want remove item in array list select location

My code is

    List<String> historylist = Arrays.asList(history);
    if (historylist.size()>=3){
        System.out.print("*************************************************");
        Log.i(MyContants.StoredHistory_TAG,"StoredHistory size========="+ String.valueOf(historylist.size()));
        String removePosition=historylist.get(2);
        historylist.remove(removePosition);
    }

but i got a Exception UnsupportedOperationException

error

    12-20 09:16:27.680: I/StoredHistory Class(5715): StoredHistory size=========3
    12-20 09:16:27.680: D/AndroidRuntime(5715): Shutting down VM
    12-20 09:16:27.684: W/dalvikvm(5715): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)
    12-20 09:16:27.688: E/AndroidRuntime(5715): FATAL EXCEPTION: main
    12-20 09:16:27.688: E/AndroidRuntime(5715): java.lang.RuntimeException: Unable to start activity ComponentInfo{****PACKAGE NAME*****}: java.lang.UnsupportedOperationException
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.os.Handler.dispatchMessage(Handler.java:99)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.os.Looper.loop(Looper.java:123)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at java.lang.reflect.Method.invokeNative(Native Method)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at java.lang.reflect.Method.invoke(Method.java:521)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at dalvik.system.NativeStart.main(Native Method)
    12-20 09:16:27.688: E/AndroidRuntime(5715): Caused by: java.lang.UnsupportedOperationException
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at java.util.AbstractList.remove(AbstractList.java:645)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at java.util.AbstractList$SimpleListIterator.remove(AbstractList.java:77)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at java.util.AbstractCollection.remove(AbstractCollection.java:230)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at ******.utills.StoredHistory.storedHistorylist(StoredHistory.java:24)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at *******.ScanResult.onCreate(ScanResult.java:53)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    12-20 09:16:27.688: E/AndroidRuntime(5715):     ... 11 more

How to cleat this issue .. Advance thanx dude

  • 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-16T02:24:43+00:00Added an answer on June 16, 2026 at 2:24 am

    Change

    List<String> historylist = Arrays.asList(history);
    

    to

     List<String> historylist = new LinkedList (Arrays.asList(history));
    

    and see this post why this error occur in case of List :

    Why do I get an UnsupportedOperationException when trying to remove an element from a List?

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

Sidebar

Related Questions

I have a std::list of boost::shared_ptr<T> and I want to remove an item from
If I want to remove an item from my list view by tapping it,
Possible Duplicate: Remove item from array by value I am maintaining string lists like
I have a list of values. I want to remove the list item when
Using KnockoutJS, how can I remove an item from an observable array? I want
I want to remove an item from ListView , but I don't know how
I want to remove remove table row from table and subsequently remove the item
I want to remove a specific context menu item, appears when the Mouse down(right)
I have an arraylist called 'pri1', I want this array list to be available
I am stuck on a problem where I want to remove all the list

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.