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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:39:45+00:00 2026-06-15T01:39:45+00:00

I have the following scenario. I have 2 packages in my application. com.example.package1; org.otherexample.package2;

  • 0

I have the following scenario.
I have 2 packages in my application.
com.example.package1;
org.otherexample.package2;

I declare in manifest like this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.example.package1"
   android:versionCode="1"
   android:versionName="1.0" >
   <activity android:name=".ActivityfromPackage1"/>
   <activity android:name="org.otherexample.package2.ActivityFromPackage2"/>

</manifest>

This being the manifest, now I want to Call From ActivityFromPackage1 ActivityFromPackage2
I’ve done like this:

import org.otherexample.package2.ActivityFromPackage2
..........
Intent intent = new Intent(this,ActivityFromPackage2.class);
startActivity(intent);

I receive following error:

Unable to start Activity com.example.package1/org.otherexample.package2.ActivityFromPackage2:
JavaLang nullpointer exception

How to call the Activity?
Thanks a lot.

  • 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-15T01:39:46+00:00Added an answer on June 15, 2026 at 1:39 am

    I suspect that something outside of what you’ve posted here is the root of your problem. I just made an example project to test it out.

    Here are my two activity declarations in manifest:

            <activity
                android:name="com.example.packagetesting.MainActivity"
                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="com.example.anotherpackage.AnotherActivity"
                android:label="@string/title_activity_another" >
            </activity>
    

    Here is the relavent bit from MainActivity:

    import com.example.anotherpackage.AnotherActivity;
    ...
    Intent i = new Intent(this, AnotherActivity.class);
    startActivity(i);
    

    Note that in my second Activity I had to import R from the main package:

    import com.example.packagetesting.R;
    

    But after doing that everything compiles and runs correctly.

    Also note in my Log file it shows:

    Starting: Intent { cmp=com.example.packagetesting/com.example.anotherpackage.AnotherActivity }
    

    Which like yours shows both of the different package names even though AnotherActivity is only in com.example.anotherpackage

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

Sidebar

Related Questions

I have following scenario: I have a XML-Document, e.g. like this <someRootElement> <tag1> <tag2
I have the following scenario. I have created an ASP.NET web application (framework 3.5)
I have following scenario: alt text http://static.zooomr.com/images/7579022_e64808b855_o.png We have a WebService which poses as
I have the following scenario... When I hover over span.share-this , it triggers a
We have the following scenario with our project: A core web application packaged as
I am trying to understand isolation/locks in SQL Server. I have following scenario in
I have the following scenario: in activity A, when a user clicks a button,
I have the following scenario: if(xml.Descendants(ns + Children).FirstOrDefault() != null) { XElement children =
I have the following scenario, a Customer who can have bank accounts in several
I have the following scenario :- template <typename T> class Base { public: virtual

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.