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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:10:57+00:00 2026-06-09T11:10:57+00:00

I am learning android and so I wrote the following code for learning ScrollView

  • 0

I am learning android and so I wrote the following code for learning ScrollView and creating multiple linearlayouts inside a linearlayout. I have created a menu to launch different activities, but the problem is when I click the class associated with this xml file, the new class (activity) doesn’t show up on the screen. What can be the problem and how can I fix it? here is the code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100"
android:padding="25dp" >

<ScrollView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="30"
>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
>
<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Name" />

<EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" >

    <requestFocus />
</EditText>

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Age" />

<EditText
    android:id="@+id/editText2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" />

<TextView
    android:id="@+id/textView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Email Address" />

<EditText
    android:id="@+id/editText3"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" />

<TextView
    android:id="@+id/textView4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Subject" />

<EditText
    android:id="@+id/editText4"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" />

<TextView
    android:id="@+id/textView5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Phone No." />

<EditText
    android:id="@+id/editText5"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" />

<TextView
    android:id="@+id/textView6"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Your Message" />

<EditText
    android:id="@+id/editText6"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10" />
</LinearLayout>
</ScrollView>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:layout_weight="40">
<Button
    android:id="@+id/button1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingTop="20dp"
    android:text="Email" />
</LinearLayout>

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="30"
    android:orientation="vertical">
<AnalogClock
    android:id="@+id/analogClock1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
</LinearLayout>

The class Email code:

package com.umer.practice2;

 import android.app.Activity;
import android.os.Bundle;
import android.widget.AnalogClock;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class Email extends Activity {

TextView t1,t2,t3,t4,t5,t6;
EditText e1,e2,e3,e4,e5,e6;
Button butn;
AnalogClock clock;
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.email);
    initializeviews();
}

private void initializeviews() {
    // TODO Auto-generated method stub
    t1= (TextView) findViewById(R.id.textView1);
    t2= (TextView) findViewById(R.id.textView2);
    t3= (TextView) findViewById(R.id.textView3);
    t4= (TextView) findViewById(R.id.textView4);
    t5= (TextView) findViewById(R.id.textView5);
    t6= (TextView) findViewById(R.id.textView6);
    e1= (EditText) findViewById(R.id.editText1);
    e2= (EditText) findViewById(R.id.editText2);
    e3= (EditText) findViewById(R.id.editText3);
    e4= (EditText) findViewById(R.id.editText4);
    e5= (EditText) findViewById(R.id.editText5);
    e6= (EditText) findViewById(R.id.editText6);
    butn=(Button) findViewById(R.id.button1);
    clock= (AnalogClock) findViewById(R.id.analogClock1);
}


}
  • 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-09T11:10:58+00:00Added an answer on June 9, 2026 at 11:10 am

    Did you added the activity in AndroidManifest.xml? Every activity need to be added into the manifest file.

    for example:

     <activity android:name=".HelloGoogleMaps" android:label="@string/app_name"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to start learning Android but have the following doubts : (1) What
I'm just learning Android. I have working piece of code that uses ContentValues: My
I am learning android so I wrote this code just to toggle phone ringer
I am currently learning how to develop applications for Android mobile devices. I wrote
I'm learning Android development. I have a basic app running on the Gingerbread emulator,
Newb question. How can you know what the main launch Activity is? Learning Android.
I have been working on learning the Android NDK the past few days, but
I have just started learning to write apps for android using Eclipse. Where can
I've been learning android development (in Eclipse) the past week. I'm following online courses
I'm learning android but have a pretty fair background in java so am a

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.