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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:39:17+00:00 2026-06-14T21:39:17+00:00

Hello everybody i have a problem that when i click a button it remains

  • 0

Hello everybody i have a problem that when i click a button it remains as it is instead of starting new activity. I searched he problem in this site and found some solutions but none of them worked for me so i am writing my problem here.

the xml layout is

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

    <TextView
        android:id="@+id/profile_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/profile" />

    <Button
        android:id="@+id/create_profile"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="@string/create_profile" />

    <Button
        android:id="@+id/edit_profile"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_toRightOf="@id/create_profile"
        android:text="@string/edit_profile" />

    <Button
        android:id="@+id/delete_profile"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_toRightOf="@id/edit_profile"
        android:text="@string/delete_profile" />

    <Button
        android:id="@+id/activate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_toRightOf="@id/delete_profile"
        android:text="@string/activate" />

    <ListView
        android:id="@id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/create_profile"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_below="@id/profile_title" />

    <TextView
        android:id="@id/android:empty"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/create_profile"
        android:layout_below="@id/profile_title"
        android:gravity="center_vertical|center_horizontal"
        android:text="@string/no_profiles" />

</RelativeLayout>

and the activity is

package com.android.SmartSwitch;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Profile_Manager extends Activity {
    private Button createButton;
    private Button editButton;
    private Button deleteButton;
    private Button activateButton;


    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.profile);
        setUpViews();
    }



    private void setUpViews() {
        createButton = (Button)findViewById(R.id.create_profile);
        editButton = (Button)findViewById(R.id.edit_profile);
        deleteButton = (Button)findViewById(R.id.delete_profile);
        activateButton = (Button)findViewById(R.id.activate);

        createButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(Profile_Manager.this, Add_Profile.class);
                startActivity(intent);
            }
        });

        editButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {

            }
        });

        deleteButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {

            }
        });

        activateButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {

            }
        });
    }

}

androidmanifest.xml

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

    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Location_Manager" android:label="@string/app_name"/>
        <activity android:name=".Profile_Manager" android:label="@string/app_name"/>
        <activity android:name=".Schedule_Manager" android:label="@string/app_name"/>
        <activity android:name=".Location_In_Map" android:label="@string/app_name"/>
        <activity android:name=".Add_Profile" android:label="@string/app_name"/>
        <uses-library android:name="com.google.android.maps" />

    </application>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest>

When i click createButton, it doesn’t respond

  • 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-14T21:39:18+00:00Added an answer on June 14, 2026 at 9:39 pm

    As your Main Activity i.e., Profile_Manager consists of the following Code:

    <activity
            android:label="@string/app_name"
            android:name=".SmartSwitchActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    

    You have to note if the Profile Manager class is the class which will be launched i.e., if Profile_Manager Class is the First Screen then, you should create the above code in AndroidManifest.xml with the only change as android:name=”.Profile_Manager” instead of “SmartSwitchActivity” with the code additionally added for Add_Profile class as follows

    <activity
            android:label="@string/app_name"
            android:name=".Add_Profile" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    

    I suppose by doing this changes,things will work fine.

    If you are not able to understand the above working then,Here is the Link with Perfect Working Example and with available Source Code-Correct Working of Button Click

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

Sidebar

Related Questions

Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello everybody I have a problem with exception. The following code block do this
Hello everybody, I have this problem (title of the post). Failure/Error: get :create, :user
Hello everybody in StackOverflow, I'm a Fan of this site, has helped me out
Hello everybody :D I would like to ask for your help on this problem.
Hello everybody I have this string: [JOLLY BLU at STAY SHIP, Voy: 0275/11] How
Hello everybody and thanks for reading. I have this html; <i class=icon-plus icon-white> Test
Hello everybody i'm looking for some help with the next problem: i have a
Hello everybody i have asp.net mvc4 application where i made countdown something like this:
Hello everybody I have a LINQ declaration like this : var query = from

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.