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

The Archive Base Latest Questions

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

from my application i’m trying to open another one, using this code: package com.copag.lanceappli;

  • 0

from my application i’m trying to open another one, using this code:

package com.copag.lanceappli;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Intent;


public class LanceAppli extends Activity {


    public void LanceAppli() {

           try
            {
                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.addCategory("android.intent.category.LAUNCHER");
                intent.setComponent(new ComponentName("test.test.test","test.test.test.MainActivity"));
                startActivity(intent);
            }
            catch( ActivityNotFoundException e)
            {
                e.printStackTrace();
            }
            catch( Exception e)
            {
                e.printStackTrace();
            }

    }
   public  void main (String [] args) 
   {
       LanceAppli();
   }    
}

what happens is that the application crushs… with no error message.

here is what i get:

http://pastie.org/5030644

any ideas?

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

    The problem is that I’ve tried to use the intent directly on the constructor as David said. So I’ve changed it to:

    package com.copag.lanceappli;
    
    import android.app.Activity;
    import android.content.ActivityNotFoundException;
    import android.content.ComponentName;
    import android.content.Intent;
    import android.os.Bundle;
    
    public class LanceAppli extends Activity {
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            try {
                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.addCategory("android.intent.category.LAUNCHER");
                intent.setComponent(new ComponentName("test.test.test","test.test.test.MainActivity"));
                startActivity(intent);
            } catch( ActivityNotFoundException e) {
                e.printStackTrace();
            } catch( Exception e) {
                e.printStackTrace();
            }
        }
    }
    

    So I put the code into onCreate as it should be and it’s working!

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

Sidebar

Related Questions

I'm using following code to open URL on a button click from application: [[UIApplication
I have a windows from application with a program.cs code like this: static class
I'm trying to implement a single-sign-on link from application written in JAVA, to another
using ... $this->getInvokeArg('bootstrap')->getOptions(); .. to retrieve my config settings from application.ini (using Zend Framework
I'm developing a Python application; it has all its code in one package and
I'm working on C# COM component. This component is called from application plugin and
In this Silverlight application, I am trying to access a resource from Application.Resources in
how to delete/remove call log from application. I am doing like this this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,null,null); it
i want copy pdf file from application path(/data/data/package name) to sdcard.for that i have
I am trying to convert an application I support from application.cfm to application.cfc. I

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.