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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:12:42+00:00 2026-05-15T16:12:42+00:00

I am new to android. I have a loginActivity which validates a user number

  • 0

I am new to android. I have a loginActivity which validates a user number and then starts a “searchactivity”.

At runtime, I see the search activity coming up (after user is validated) but then android is having problems stopping the loginActivity.

I am getting a “java.lang.runtimeexception: Unable to stop activity {com.insruance/com.insurance.LoginActivity}: android.app.SuperNotCalledException : Activity
at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3413)”

I would really appreciate if someone could point to what I am doing wrong.

Code :

public class LoginActivity extends Activity{

 DatabaseWrapper myDbHelper;
 private String agentNumber;
 private OnClickListener btnClickListner = new OnClickListener() 
 {  
  @Override
  public void onClick(View v) 
  {
   // TODO Auto-generated method stub   
   // = new DataBaseHelper();   
   try {

    Log.d("LoginActivity->onClick", "Before findByID");
    EditText editText = (EditText)findViewById(R.id.txtUserNumber);
    Log.d("LoginActivity->onClick", "After findByID");
    agentNumber = editText.getText().toString();
    String msg = "";
    AgentDbHelper agentHelper = new AgentDbHelper(myDbHelper.getDatabaseHandle());
    Log.d("LoginActivity->onClick", "Before agentIDExists");    
    if (agentHelper.agentIDExists(agentNumber))
     msg = "Login success";
    else
     msg = "Login failed";
    Log.d("LoginActivity->onClick", "After agentByID");
    myDbHelper.closeDatabase();
    myDbHelper = null;
    Toast.makeText(getBaseContext(), 
      "User " + agentNumber + " found!", 
      Toast.LENGTH_LONG).show();
    callSearchActivity();
   } 
   catch(SQLException sqlEx)
   {
    Log.d("login - onclick", sqlEx.toString());
   }
   catch (Exception e) {
    // TODO: handle exception
    Log.d("login - onclick", e.toString());
   } 
  }
 }; 

 private void callSearchActivity()
 {
  Intent intent = new Intent(getBaseContext(), SearchActivity.class);
  Bundle bun = new Bundle();
  bun.putString("agentNumber", agentNumber);
  intent.putExtras(bun);
  startActivity(intent);  
 }

 @Override
 public void onStop() {  
  try {
   Log.d("In LoginActivity->onStop", "about to close myDbHelper");
   if (myDbHelper != null)
   {
    myDbHelper.closeDatabase();
    Log.d("In LoginActivity->onStop", "after myDbHelper is closed");
   }
  } catch (Exception e) {
   // TODO Auto-generated catch block
   Log.d("In LoginActivity->onStop exeption", e.toString());
   //e.printStackTrace();
  }
 }
 @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {        
         setContentView(R.layout.login);
         Button loginButton = (Button)this.findViewById(R.id.btnLogin);
         loginButton.setOnClickListener(btnClickListner);
         myDbHelper = new DatabaseWrapper(this);
         myDbHelper.openDatabase();
        }
        catch(Exception e) {
      Log.e("ERROR", "ERROR IN CODE:"+e.toString());
     }

}
}

  • 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-15T16:12:43+00:00Added an answer on May 15, 2026 at 4:12 pm

    A little more digging pointed me to this.

    I was not calling super.onStop() within the overriden onStop.

    I would have thought that Eclipse would have scripted this line when it created the onStop for me.

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

Sidebar

Related Questions

I’m new to android,I have an activity class which fetches Json string from url
I am new to android development. I have created a popup window which is
i am new to android.i have one single activity with main.xml file. Now, i
I am new to Android.I have created a dynamic textview which is displayed on
I am new to android.I have a image which is declared in xml file
I'm new to Android, but have published iphone and bberry apps. I see that
I am new in android I have created 2 classes.first extends activity and 2nd
I am new to android.I have a response of strings which i need to
hi to all i am new to android i have to send my different
I am a bit new with android but I have some java experience. So

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.