2 Replies - 6444 Views - Last Post: 05 April 2010 - 04:44 PM

#1 prototype.joey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 23-February 10

[Android] Can I start an activity that is defined in an external libra

Posted 30 March 2010 - 07:20 PM

I am developing a social network framework library for Android, which is irrelevant, but I would like the ability to invoke an Activity that is defined within the library. Does anyone know if this is possible? I've been trying to do this for several days and am falling behind schedule so I'm about to try another method like just creating a class (in the application package) that extends the activity in the library package, however it seems pointless as the library should handle everything on it's own.

My attempts so far are as follows. Please excuse the poor naming convention.
My library is a jar containing package "A". "A" contains another package called "pkgA", which contains an activity class named Act. Fully qualified name is "A.pkgA.Act".

The application is contained in package "B.Test".
The main activity is called "main". Fully qualified name would be "B.Test.main".

I want to invoke Act from main in the fashion

Intent i = new Intent(this, A.pkgA.Act.class);
this.startActivity(i);

The manifest file contains an activity element with the fully qualified name for the activity, which looks like this..
<activity android:name="A.pkgA.Act" android:label="ACTIVITY!!!"/>

The IDE doesn't flag an error since it is a valid class that it can locate, but when I try to install it, I get an error saying

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

I've scoured the net and no one ever seems to have this issue, nor do they ever really mention using activities that are stored in external jar files. Please someone help!!

Is This A Good Question/Topic? 0
  • +

Replies To: [Android] Can I start an activity that is defined in an external libra

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6091
  • View blog
  • Posts: 23,605
  • Joined: 23-August 08

Re: [Android] Can I start an activity that is defined in an external libra

Posted 03 April 2010 - 07:07 AM

Moved from Android Tutorials.
Was This Post Helpful? 0
  • +
  • -

#3 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: [Android] Can I start an activity that is defined in an external libra

Posted 05 April 2010 - 04:44 PM

Post your AndroidManifest.xml.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1