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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:01:45+00:00 2026-06-01T11:01:45+00:00

New to android programming. Getting Following error. 04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main java.lang.OutOfMemoryError

  • 0

New to android programming. Getting Following error.

04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main
        java.lang.OutOfMemoryError
        at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
        at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:145)
        at java.lang.StringBuilder.append(StringBuilder.java:216)
        at com.myapp.StartupActivity.onListItemClick(StartupActivity.java:87)
        at android.app.ListActivity$2.onItemClick(ListActivity.java:319)
        at android.widget.AdapterView.performItemClick(AdapterView.java:292)
        at android.widget.AbsListView.performItemClick(AbsListView.java:1058)
        at android.widget.AbsListView$PerformClick.run(AbsListView.java:2514)
        at android.widget.AbsListView$1.run(AbsListView.java:3168)
        at android.os.Handler.handleCallback(Handler.java:605)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4340)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
        at dalvik.system.NativeStart.main(Native Method)

Using tab layout and there are three activities for controlling tabs. I think i crossed memory heap available to my app. Can someone tell me how to destroy objects when you navigate away from tab? Error happens in following code.

String separator = "|"
String myString = "";
for(String string : Mylist)
{
    myString += myString + string + separator;
}
  • 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-01T11:01:46+00:00Added an answer on June 1, 2026 at 11:01 am

    try String separator = "\\|"
    instead String separator = "|"

    there is a problem in using pipe symbol using java or you can use Pattern.quote("|")

    @Qerub
    It’s worth noting that the double-slash is only necessary if the expression string is compiled into your java code.

    One slash is needed by the Java compiler so that it stores a literal slash in the expression String object. This isn’t unique to regular expressions, all Java Strings compiled in the class files work this way. If you want one slash in your String in your compiled class file, type two slashes in your Java source.

    If the regular expression is passed into the Java program at runtime — via command-line arguments, or a property value — this first slash is not necessary.

    Another slash is needed by the regular expression parser so that the pipe is treated as a literal character. The expression parser doesn’t care whether the string was compiled into the class file or provided at runtime.

    Source code: \\|
    
    which compiles to...
    
    Class file: \|
    

    now is read by regular expression parser as…

    Expression parser treats as: |

    While the same we used in split() then it treated as alteration, which mean string get split by every character

    Source code: “query”

    "query".split("|") give result like

    q
    u
    e
    r
    y
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Android and Java programming. I have a class which implements
I'm new to Android & Java programming but have been programming in .NET for
I'm still new to programming/Java/Android so I'm trying to understand everything I do and
I'm really new in Android programming, so I have a simple question getting a
Android Programming The following code int year = new Time().year; is returning value of
I am fairly new to Android programming, but I am getting pretty good at
I am new to Android programming, but not to programming in general or Java.
I am fairly new to Java programming and was following a tutorial located here:
I am rather new to Android programming and Java in general (like… one week
I am new to Android and Java Programming and I want to ask if

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.