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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:46:18+00:00 2026-05-31T01:46:18+00:00

I am trying to develop a small app BusTracker which will list down a

  • 0

I am trying to develop a small app BusTracker which will list down a list of buses when you mention the from and to places.
I have a frombutton which when clicked will call another activity(which is a listactivity) that will show a list of places. I choose one and the place gets saved and textfield in the firstActivity gets populated with that. I’m getting stackOverFlowerror in the oncreate method of the second activity. can anyone pls give me a possible reason for this?

Here is my code in the firstActivity onClick method

case R.id.from_button:
Intent i= new Intent(this,PlacesActivity.class);
startActivity(i);
String ss=PlacesActivity.getPlace();

Then in the secondActivity

this.onCreate(onSavedInstanceState);
    setContentView(R.layout.places);
     ListView placesList=(ListView)this.findViewById(R.layout.places);

     placesList.setVisibility(View.VISIBLE);
     placesList.setAdapter(new ArrayAdapter(this,R.array.fromArray));
     placesList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
     //placesList.setOnItemClickListener(this);

}

public void onListItemClick(ListView l, View v, int position, long id)
{
    Object o=this.getListAdapter().getItem(position);
    String s=o.toString();
    place=s;
    System.out.println("sssssssssssss"+s);
}

Error I get:

03-10 18:02:46.352: E/AndroidRuntime(542): FATAL EXCEPTION: main
03-10 18:02:46.352: E/AndroidRuntime(542): java.lang.StackOverflowError
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
  • 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-31T01:46:20+00:00Added an answer on May 31, 2026 at 1:46 am

    You shouldn’t call this.onCreate(onSavedInstanceState);, but super.onCreate(onSavedInstanceState); otherwise you are in an endless recursion of calling on create and then you get the STackOverflow.

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

Sidebar

Related Questions

I'm trying to develop a script which will, in part, generate a list of
I am trying to develop a small app, that will store User's input about
I'm trying to develop small app that will be registered on PhoneStateListener and do
Small design question here. I'm trying to develop a calculation app in C#. I
Im trying to develop my first ASP.NET MVC web app and have run into
I am new to C# and trying to develop a small application which internally
I'm trying to develop a small app like Flash Player updater. I want users
I have to develop a small application that will connect to a Linux server
I'm trying to develop a small utility (a WinForms app) and I was hoping
I'm trying to develop a small application that tests how many requests per second

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.