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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:14:19+00:00 2026-05-27T21:14:19+00:00

Currently I’m developing a registration form for new user in Android (native app.) and

  • 0

Currently I’m developing a registration form for new user in Android (native app.) and by using .php file. By runnig the code I’m getting following error: “Unfortunately, application has stopped”. I tried to change code in many ways to solve it, but without any result. Here is the php code:

<?php 
$dbcnx = @mysql_connect("localhost", "root", "root");
$db = "dbname";
mysql_select_db($db, $dbcnx);
$user_id=$_POST['user'];
$passwd=$_POST['passwd'];
$query = 'INSERT INTO `users` VALUES (NULL, \''.$user_id.'\', \''.$passwd.'\')';
$result = mysql_query($query) or die ("<b>Query failed:</b> " . mysql_error());

mysql_free_result($result);
mysql_close($dbcnx);
?>

And .java file:

import java.util.ArrayList;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Register extends ListActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.register);

    Button Insert=(Button)findViewById(R.id.send_button);
    Insert.setOnClickListener(new View.OnClickListener() {          
        public void onClick(View v) {
            // TODO Auto-generated method stub
            try {
                EditText Text1=(EditText)findViewById(R.id.user_id);
                EditText Text2=(EditText)findViewById(R.id.passwd);                 

                ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
                nameValuePairs.add(new BasicNameValuePair("user", ""+Text1.getText().toString()+""));
                nameValuePairs.add(new BasicNameValuePair("passwd", ""+Text2.getText().toString()+""));

                Log.e(""+Text1.getText().toString(),"0");
                Log.e(""+Text2.getText().toString(),"0");
                HttpClient httpclient = new DefaultHttpClient();
                HttpPost httppost = new HttpPost("http://10.0.2.2/jku/user_reg.php");
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, HTTP.UTF_8));
                HttpResponse response = httpclient.execute(httppost);
            }
            catch(Exception e) {
                Log.e("log_tag", "Error in http connection "+e.toString());
            }

        }
    });

}   

}

I fixated on my mistakes, so I’m beginner in android and any suggestions would be helpful.

I’ve checked LogCat but nothing understand. So here is the log story:

01-04 21:37:13.275: D/gralloc_goldfish(552): Emulator without GPU emulation detected.
01-04 21:37:13.345: W/TextLayoutCache(552): computeValuesWithHarfbuzz -- need to force to single run
01-04 21:37:47.385: D/AndroidRuntime(552): Shutting down VM
01-04 21:37:47.385: W/dalvikvm(552): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
01-04 21:37:47.476: E/AndroidRuntime(552): FATAL EXCEPTION: main
01-04 21:37:47.476: E/AndroidRuntime(552): java.lang.RuntimeException: Unable to start activity ComponentInfo{jku.project.kusss/jku.project.kusss.Register}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.os.Looper.loop(Looper.java:137)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ActivityThread.main(ActivityThread.java:4340)
01-04 21:37:47.476: E/AndroidRuntime(552):  at java.lang.reflect.Method.invokeNative(Native Method)
01-04 21:37:47.476: E/AndroidRuntime(552):  at java.lang.reflect.Method.invoke(Method.java:511)
01-04 21:37:47.476: E/AndroidRuntime(552):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-04 21:37:47.476: E/AndroidRuntime(552):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-04 21:37:47.476: E/AndroidRuntime(552):  at dalvik.system.NativeStart.main(Native Method)
01-04 21:37:47.476: E/AndroidRuntime(552): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ListActivity.onContentChanged(ListActivity.java:243)
01-04 21:37:47.476: E/AndroidRuntime(552):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:254)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.Activity.setContentView(Activity.java:1835)
01-04 21:37:47.476: E/AndroidRuntime(552):  at jku.project.kusss.Register.onCreate(Register.java:27)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.Activity.performCreate(Activity.java:4465)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
01-04 21:37:47.476: E/AndroidRuntime(552):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
01-04 21:37:47.476: E/AndroidRuntime(552):  ... 11 more
  • 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-27T21:14:20+00:00Added an answer on May 27, 2026 at 9:14 pm

    Your answer is in the error stack:

    Caused by: java.lang.RuntimeException: Your content must have a ListView whose id
    attribute is 'android.R.id.list'
    

    Since you didn’t show all of your code, lets assume you’re using a ListActivity or a ListFragment or whatever. To use that, the view must have a ListView child with an ID of android.R.id.list.

    Read the paragraph under ‘Screen Layout’ in this d.android.com link.

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

Sidebar

Related Questions

Currently I using the following code to get my JSON output from MySQL. <?php
Currently, I am developing a product that does fairly intensive calculations using MS SQL
I want use html5's new tag to play a wav file (currently only supported
Currently, I pass the StackFrame to grab the current file/line number: Log.Message(new StackFrame(0, true),
Currently, I'm developing an app that functionality heavily relies upon retrieved JSON data. Most
Currently, I'm developing an application for Android OS. I would like to know the
Currently I got this code: function post_positive(id) { if (window.XMLHttpRequest) { xmlhttp = new
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently I know of only two ways to cache data (I use PHP but
Currently am developing a program that solves (if possible) any given labyrinth of dimensions

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.