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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:00:18+00:00 2026-06-05T06:00:18+00:00

I tried to add two buttons in my Android application to select an application

  • 0

I tried to add two buttons in my Android application to select an application from separate two applications Order system and Inventory system.As shown in the image.

enter image description here

I have implemented these two applications as separate two Android projects. When I try to run this application it comes until to the the selecting window correctly, but when one button is pressed emulator shows “Force Close” message.
I have added Order system and Inventory system projects to first application’s build path and then import their packages(com.oms.ws and com.inv.ws). This may be incorrect, but don’t know how to do this. Please help me! I’m new to Android.
I want to test this application using the emulator!

Here is the code I have used to select applications.

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;
import com.oms.ws.*;

 public class ThirdScreen extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.thirdscreen);

    Button oms;
    oms = (Button)findViewById(R.id.orderSystem); 
    oms.setOnClickListener(ordrMnagemntSys);

    Button inventory;
    inventory = (Button)findViewById(R.id.inventorySystem); 
    inventory.setOnClickListener(inventorySys);

}

private OnClickListener ordrMnagemntSys = new OnClickListener(){
    public void onClick(View v) {

            Intent oMs = new Intent(getApplicationContext(), com.oms.ws.TestOms.class);
            startActivity(oMs);
            }
};

private OnClickListener inventorySys = new OnClickListener(){
    public void onClick(View v) {

            Intent inven = new Intent(getApplicationContext(), com.inv.ws.TestInventory.class);
            startActivity(inven);
            }
};
}

Thanks!

  • 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-05T06:00:19+00:00Added an answer on June 5, 2026 at 6:00 am

    Ok This works

    Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("org.abc");
    startActivity(LaunchIntent);
    

    Replace org.abc with package name of the application which you want to start.

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

Sidebar

Related Questions

I tried to add lighting to my OpenGLES2 application following the tutorial at http://www.learnopengles.com/android-lesson-two-ambient-and-diffuse-lighting/
I've made a app with two buttons one to select an image from the
I am trying to add two right buttons to the navigation bar. I tried
I tried to add buttons, textboxes and text to tableview. I want the row
Ok, I've tried two examples of AlarmManager- one from the commonsware website, and one
iPhone application, which has two buttons -right side- of Navigation Bar title. I want
I would like to add a gap between two buttons on an Eclipse toolbar.
I am creating a window with two image buttons (using TriplePlay in my playN
I tried to add an icon to one of my context menu items, but
I tried to add a custom item template to Visual C++ Express 2008, but

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.