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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:12:17+00:00 2026-06-07T23:12:17+00:00

I am facing strange problem dont know what is responsible for this. I have

  • 0

I am facing strange problem dont know what is responsible for this.
I have 3 views

ConsumerRegistration.java->registration.xml
Login.java->main2.xml
Toc.java->terms.xml

Whenever i run 3 views independently there is no issue, when i call Toc from Login or Login from Toc then also there is no issue but when i call ConsumerRegistration form either Toc or Login then it is throwing unexpected error resulting the application to shut down . Codes for java and layout files are as below

Login.java

    package com.multiview.org;
    import android.app.Activity;  
    import android.content.Intent;  
    import android.os.Bundle;  
    import android.view.View;  
    import android.widget.Button;  
     public class Login extends Activity {  
        /** Called when the activity is first created. */  
        @Override  
        public void onCreate(Bundle savedInstanceState) {  
          super.onCreate(savedInstanceState);  
          setContentView(R.layout.main2);  
          Button next = (Button) findViewById(R.id.button2);  
                next.setOnClickListener(new View.OnClickListener() {  
                 public void onClick(View view) {  

                  Intent myIntent = new Intent(view.getContext(), ConsumerRegistration.class);  
                   startActivityForResult(myIntent, 0);  
                 }  
               });  
        }  
      }  


main2.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <Button android:text="View 1"  
              android:id="@+id/button2"  
             android:layout_width="fill_parent"  
              android:layout_height="wrap_content">  
          </Button>  

    </LinearLayout>

ConsumerRegistration.java

    package com.multiview.org;

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.ClientProtocolException;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.entity.StringEntity;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.message.BasicHeader;
    import org.apache.http.protocol.HTTP;
    import org.json.JSONArray;
    import org.json.JSONException;
    import org.json.JSONObject;
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.RadioButton;
    import android.widget.Toast;

    public class ConsumerRegistration extends Activity {
        /** Called when the activity is first created. */
        EditText un,pw,pc,by,zc;
        RadioButton m,f;
        JSONObject j;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.registration);

             un = (EditText)findViewById(R.id.et_un);
             pw = (EditText)findViewById(R.id.et_pw);
             pc = (EditText)findViewById(R.id.et_pc);
             by = (EditText)findViewById(R.id.et_by);
             zc = (EditText)findViewById(R.id.et_zc);
             m=(RadioButton)findViewById(R.id.rb_m);
             f=(RadioButton)findViewById(R.id.rb_f);



            Button ok = (Button)findViewById(R.id.btn_login);
            ok.setOnClickListener(new View.OnClickListener() {

                public void onClick(View v) {
                    j = new JSONObject();
                    try {
                    j.put("username", un.getText().toString());
                    j.put("password", pw.getText().toString());
                    j.put("email", un.getText().toString());
                    j.put("is_active", "1");
                    j.put("is_staff", "0");
                    j.put("is_superuser","0");
                    j.put("promo_code", pc.getText().toString());
                    j.put("gender", "m");
                    j.put("zip", zc.getText().toString());
                    j.put("birth_year", by.getText().toString());
                    j.put("first_name", "john");
                    j.put("last_name", "doe");
                    j.put("current_state", "1");


                    } catch (JSONException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    HttpClient httpclient = new DefaultHttpClient();
                    HttpPost httppost = new HttpPost("http://10.0.2.2:8000/api/ecp/user/?format=json");
                    try {
                        HttpEntity entity;
                        StringEntity s = new StringEntity(j.toString());
                        s.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                        entity = s;
                        httppost.setEntity(entity);
                        HttpResponse response;
                        response = httpclient.execute(httppost);
                        entity = response.getEntity();
                        InputStream is = entity.getContent();
                        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                        StringBuilder sb = new StringBuilder();

                        String line = null;
                        try {
                            while ((line = reader.readLine()) != null) {
                                sb.append((line + "\n"));
                            }
                        } catch (IOException e) {
                            e.printStackTrace();
                        } finally {
                            try {
                                is.close();
                            } catch (IOException e) {
                                e.printStackTrace();
                            }
                        }
                        try {
                            Toast.makeText(ConsumerRegistration.this, "created", Toast.LENGTH_SHORT).show();
                            JSONObject jsonObject = new JSONObject(sb.toString());
                            JSONObject meta = jsonObject.getJSONObject("meta");  
                            String limit = meta.getString("limit");  
                            Toast.makeText(ConsumerRegistration.this, limit, Toast.LENGTH_SHORT).show();
                            JSONArray array = jsonObject.getJSONArray("objects");

                            String key = array.getJSONObject(0).getString("api_key");
                            String uname = array.getJSONObject(0).getString("username");
                            Toast.makeText(ConsumerRegistration.this, j.toString(),
                                    Toast.LENGTH_SHORT).show();

                        } catch (JSONException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }   
                        //Toast.makeText(HelloWorldActivity.this, sb.toString(), Toast.LENGTH_SHORT).show();
                    } catch (ClientProtocolException e) {
                        Toast.makeText(ConsumerRegistration.this, e.toString(), Toast.LENGTH_SHORT).show();

                        // TODO Auto-generated catch block
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        Toast.makeText(ConsumerRegistration.this, e.toString(), Toast.LENGTH_SHORT).show();

                    }


                }
            });

            Button next = (Button) findViewById(R.id.btnLogin);  
            next.setOnClickListener(new View.OnClickListener() {  
             public void onClick(View view) {  
               Intent myIntent = new Intent(view.getContext(), Login.class);  
               startActivityForResult(myIntent, 0);  
             }  
           });
        }

    }

Registration.xml

    <TableLayout 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        xmlns:android="http://schemas.android.com/apk/res/android">
        <TableRow>
            <Button 
                android:id="@+id/btnLogin"
                android:text="Login"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </TableRow>
        <TableRow>
            <TextView
            android:id="@+id/tv_un"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="Login Email:"
            android:textColor="#444444"
            android:textSize="10pt" />

            <EditText
                android:id="@+id/et_un"
                android:layout_width="150dip"
                android:layout_height="wrap_content"
                android:layout_alignTop="@id/tv_un"
                android:layout_toRightOf="@id/tv_un"
                android:background="@android:drawable/editbox_background" />
        </TableRow>
        <TableRow>
            <TextView
                android:id="@+id/tv_pw"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignRight="@+id/textView2"
                android:layout_below="@+id/et_un"
                android:text="Password:"
                android:textColor="#444444"
                android:textSize="10pt" />
        <EditText
            android:id="@+id/et_pw"
            android:layout_width="150dip"
            android:layout_height="wrap_content"
            android:background="@android:drawable/editbox_background"
            android:ems="10"
            android:password="true" />  
         </TableRow>
         <TableRow>
             <TextView
                android:id="@+id/tv_pc"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBaseline="@+id/et_pc"
                android:layout_alignBottom="@+id/et_pc"
                android:layout_alignParentLeft="true"
                android:text="Promo Code"
                android:textColor="#444444"
                android:textSize="10pt" />
            <EditText
                android:id="@+id/et_pc"
                android:layout_width="150dip"
                android:layout_height="wrap_content"
                android:layout_alignTop="@id/tv_un"
                android:layout_toRightOf="@id/tv_un"
                android:background="@android:drawable/editbox_background" />

         </TableRow>
         <TableRow>
             <TextView
                android:id="@+id/tv_g"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:text="Gender"
                android:textColor="#444444"
                android:textSize="10pt" />
                 <RadioGroup
                    android:id="@+id/radioSex"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" >

                    <RadioButton
                        android:id="@+id/rb_m"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="true"
                        android:text="Male" />

                    <RadioButton
                        android:id="@+id/rb_f"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Female" />

                  </RadioGroup>


         </TableRow>
         <TableRow>

             <TextView
                 android:id="@+id/textView2"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="Birth Year"
                 android:textColor="#444444"
                 android:textSize="10pt" />

          <EditText
            android:id="@+id/et_by"
            android:layout_width="150dip"
            android:layout_height="wrap_content"
            android:layout_alignTop="@id/tv_un"
            android:layout_toRightOf="@id/tv_un"
            android:background="@android:drawable/editbox_background" />

         </TableRow>
         <TableRow>
             <TextView
                android:id="@+id/textView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBaseline="@+id/et_zc"
                android:layout_alignBottom="@+id/et_zc"
                android:layout_alignLeft="@+id/textView2"
                android:text="Zip Code"
                android:textColor="#444444"
                android:textSize="10pt" />

             <EditText
                android:id="@+id/et_zc"
                android:layout_width="150dip"
                android:layout_height="wrap_content"
                android:layout_alignTop="@id/tv_un"
                android:layout_toRightOf="@id/tv_un"
                android:background="@android:drawable/editbox_background" />

         </TableRow>
         <TableRow>
                 <Button
                    android:id="@+id/btn_back"
                    android:layout_width="100dip"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:text="Back" />


                 <Button
                    android:id="@+id/btn_login"
                    android:layout_width="100dip"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:text="Next" />


         </TableRow>
    </TableLayout>

Toc.java

    package com.multiview.org;
    import android.app.Activity;  
    import android.content.Intent;  
    import android.os.Bundle;  
    import android.view.View;  
    import android.widget.Button;  
     public class Toc extends Activity {  
        /** Called when the activity is first created. */  
        @Override  
        public void onCreate(Bundle savedInstanceState) {  
          super.onCreate(savedInstanceState);  
          setContentView(R.layout.terms);  
          Button next = (Button) findViewById(R.id.btnAccept);  
                next.setOnClickListener(new View.OnClickListener() {  
                 public void onClick(View view) {  
                   Intent myIntent = new Intent(view.getContext(), Login.class);  
                   startActivityForResult(myIntent, 0);  
                 }  
               });  
        }  
      }  


terms.xml

    <?xml version="1.0" encoding="utf-8"?>
    <TableLayout 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        xmlns:android="http://schemas.android.com/apk/res/android">
        <TableRow>

            <EditText
                android:id="@+id/EditText02"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:ems="10"
                android:gravity="top|left"
                android:inputType="textMultiLine"
                android:lines="5"
                android:scrollHorizontally="false" 
                android:value="this is test"/>
        </TableRow>
        <TableRow>

            <Button
                android:id="@+id/button2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Back" />


            <Button
                android:id="@+id/btnAccept"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Accept" />
        </TableRow>
    </TableLayout>

Manifest file


    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.multiview.org"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk android:minSdkVersion="10" />
        <uses-permission android:name="android.permission.INTERNET" />

        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity
                android:name=".Toc"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".Login"></activity>
        </application>

    </manifest>

Please let me how to find where exactly is unexpected error… thank you

  • 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-07T23:12:19+00:00Added an answer on June 7, 2026 at 11:12 pm

    You have not declared ConsumerRegistration Activity in manifest. Declare it and try again.

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

Sidebar

Related Questions

I am facing a strange problem and have no idea how to fix this
We are facing a strange problem. We have a user control written in WPF
I am facing quite a strange problem at the moment, I have wordpress and
I'm facing a kind of strange problem and don't know in which direction to
I have been facing a strange problem while returning dataset through WCF service (WSHttpBinding).
I am facing a very strange problem. I have a grid and when i
I am facing this strange problem with strings. I assigned a string like this:
Well, I am facing a strange problem. I have developed a sample MFC ribbon
I am facing this strange problem while working with Generic Base Classes. I am
I'm facing this strange problem. I'm trying to read a file that is located

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.