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

  • Home
  • SEARCH
  • 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 8053523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:52:27+00:00 2026-06-05T07:52:27+00:00

I want to link my two activites by clicking on a button i have

  • 0

I want to link my two activites by clicking on a button i have written the following code

public class IHBCAPTUREActivity extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    ImageView iv;
    TextView tx;
    Button b1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        iv=(ImageView)findViewById(R.id.imageView1);
        tx=(TextView)findViewById(R.id.textView1);
       b1 = (Button) findViewById(R.id.button1);
       b1.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

        Intent calIntent;
        **calIntent = new Intent(IHBCAPTUREActivity.this, LoginActivity.class);**
        startActivity(calIntent);           
    }
}

error cumes in this line

calIntent = new Intent(IHBCAPTUREActivity.this, LoginActivity.class);

for LoginActivity.class that

LoginActivity cannot be resolved to a type . How to solve it?

  • 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-05T07:52:29+00:00Added an answer on June 5, 2026 at 7:52 am

    here is the simple code how you can load one activity to another,

    i have created two activities like this

    FirstActivity.java

    package com.rdc;
    
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    
    public class FirstActivity extends Activity implements OnClickListener {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.first);
    
            Button btnload = (Button) findViewById(R.id.btn);
            btnload.setOnClickListener(this);
        }
    
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent i = new Intent(this, SecondActivity.class);
            startActivity(i);
        }
    }
    

    SecondActivity.java

    package com.rdc;
    
    import android.app.Activity;
    import android.os.Bundle;
    
    public class SecondActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.second);
    
    
        }
    }
    

    and my manifest file is

    AndroidManifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.rdc"
          android:versionCode="1"
          android:versionName="1.0">
        <uses-sdk android:minSdkVersion="8" />
    
        <application android:icon="@drawable/icon" android:label="@string/app_name">
            <activity android:name=".FirstActivity"
                      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=".SecondActivity"
                      android:label="@string/app_name">
                <intent-filter>                
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    
        </application>
    </manifest>
    

    try to implement this in your app and let me know if still any doubt is there.

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

Sidebar

Related Questions

I want to apply a different hyper link style to the following two things:
I have two toggle buttons that I want to link together so that pressing
I have two CSS pages, I want to link the HTML page to one
I have 2 php files and I want to link the two files by
I have two lists: link_ids = ['111','222','333'] filenames = ['111-foo.txt','111-bar.txt','222.txt'] I want to do
I want to link the onclick event of the radio button to the new
I have several sites that I want to link back to the main site
Suppose I have a table whose function is specifically to link two other tables
I have two tables users registered_members I want to confirm values from user table
i want to link the two nodes of a jtree ,one node of right

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.