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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:44:29+00:00 2026-05-26T15:44:29+00:00

I have a multi screen app that only the first button works. alll of

  • 0

I have a multi screen app that only the first button works. alll of the other buttons crash when they go to the next java file. In the manifest I have all of them listed but I have no idea why its crashing. any ideas?
package com.mike.BrowserScreen;
import android.app.Activity;
import android.os.Bundle;
import android.widget.;
import android.view.
;
import android.content.Intent;

 public class BrowserScreenActivity extends Activity {
 /** Called when the activity is first created. */
Button flea=null; 
Button bu1=null;
Button bu2=null;
Button bu3=null;
TextView tv1=null; 
TextView tv2=null;
TextView tv3=null; 
TextView tv4=null; 
TextView tv5=null;
TextView tv6=null; 
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    flea=(Button)findViewById(R.id.flea);
    bu1=(Button)findViewById(R.id.bu1);
    bu2=(Button)findViewById(R.id.bu2);
    bu3=(Button)findViewById(R.id.bu3);
    tv1=(TextView)findViewById(R.id.tv1);
    tv2=(TextView)findViewById(R.id.tv2);
    tv3=(TextView)findViewById(R.id.tv3);
    tv4=(TextView)findViewById(R.id.tv4);
    tv5=(TextView)findViewById(R.id.tv5);
    tv6=(TextView)findViewById(R.id.tv6);
    flea.setOnClickListener(new View.OnClickListener(){ 
    public void onClick(View v){ 
     Intent myIntent=new Intent(v.getContext(),SecondActivity.class);
    startActivity(myIntent); 
                }
          });

        bu1.setOnClickListener(new View.OnClickListener(){ 
      public void onClick(View v){ 
       Intent myIntent1=new Intent(v.getContext(),ThirdActivity.class);
     startActivity(myIntent1); 
           }
         }); 
      bu2.setOnClickListener(new View.OnClickListener(){ 
      public void onClick(View v){ 
      Intent myIntent2=new Intent(v.getContext(),FourthActivity.class);
      startActivity(myIntent2); 
          }
     });
     bu3.setOnClickListener(new View.OnClickListener(){ 
      public void onClick(View v){ 
      Intent myIntent3=new Intent(v.getContext(),FifthActivity.class);
      startActivity(myIntent3); 
        }
         }); 
      } 
    }

Heres the manifest

    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".BrowserScreenActivity"
              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"></activity>
    <activity android:name=".ThirdActivity"></activity>
    <activity android:name=".ForthActivity"></activity>
    <activity android:name=".FifthActivity"></activity>
    </application>
    </manifest>

i figured it out in the other java files i forgot to change it to the right xml file.I will have another question on launching a website from a textview or button

  • 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-26T15:44:30+00:00Added an answer on May 26, 2026 at 3:44 pm

    while starting new Activity..

    Instead of v.getContext() use BrowserScreenActivity.this or getBaseContext()

    like this

     flea.setOnClickListener(new View.OnClickListener(){ 
        public void onClick(View v){ 
         Intent myIntent=new Intent(BrowserScreenActivity.this,SecondActivity.class);
        startActivity(myIntent); 
                    }
              });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a C# windows forms application. I have a splash screen with some multi-threaded
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
I have a multi-line string that I want to do an operation on each
I have a multi-user ASP.NET app running against SQL Server and want to have
I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library.
I have a multi-timezone web application that stores all of the datetime values in
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a
I am trying to develop a multi-screen app for the Google TV platform using
We have an application that is run in multi-monitor environments. Users normally have the
I have a multiscreen app that is up and running and you can press

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.