android - Unable To Access library activity in another project -
i trying access library activity project(in tabhost , each tab call different activity.) throwing exception
caused by: android.content.activitynotfoundexception: unable find explicit activity class {com.themontcalm.droid.activity/com.themontcalm.droid.lib.activity.reservationtab}; have declared activity in androidmanifest.xml?
where :-
com.themontcalm.droid.lib.activity.reservationtab
library project. ,com.themontcalm.droid.activity
launcher project accessing library activitycode accessing project library:---
package com.themontcalm.droid.activity; import android.app.tabactivity; import android.content.intent; import android.content.res.resources; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.imagebutton; import android.widget.tabhost; public class homescreen extends tabactivity implements onclicklistener { tabhost tabhost; imagebutton location, contacts, explore; intent intent; //locationgb locationactivity = new locationgb(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_home_screen); //locationfactory.getinstance().setlocationactivity(locationgb.class); // addlisteneronbutton(); location = (imagebutton) findviewbyid(r.id.location); contacts = (imagebutton) findviewbyid(r.id.contacts); explore = (imagebutton) findviewbyid(r.id.explore); location.setonclicklistener(this); contacts.setonclicklistener(this); explore.setonclicklistener(this); resources res = getresources(); // resource object drawables // activity tabhost tabhost.tabspec spec; // reusable tabspec each tab intent intent; // reusable intent each tab tabhost = (tabhost) findviewbyid(android.r.id.tabhost); tabhost = gettabhost(); // create intent launch activity tab (to reused) intent = new intent().setclass(getbasecontext(), com.themontcalm.droid.lib.activity.reservationtab.class); spec = tabhost.newtabspec("reservation") .setindicator("", res.getdrawable(r.drawable.testing))// , // res.getdrawable(r.drawable.testing) .setcontent(intent); tabhost.addtab(spec); // same other tabs intent = new intent().setclass(this, com.themontcalm.droid.lib.activity.gallerytabactivity.class); spec = tabhost.newtabspec("modify") .setindicator("", res.getdrawable(r.drawable.testing))// ,res.getdrawable(r.drawable.testing) .setcontent(intent); tabhost.addtab(spec); intent = new intent().setclass(this, com.themontcalm.droid.lib.activity.videotabactivity.class); spec = tabhost.newtabspec("video") .setindicator("", res.getdrawable(r.drawable.testing))// , // res.getdrawable(r.drawable.testing) .setcontent(intent); tabhost.addtab(spec); // set tab 1 want open first time 0 or 1 or 2 tabhost.setcurrenttab(0); } @override public void onclick(view v) { // todo auto-generated method stub if (v == location) { // intent = new intent(homescreen.this, locationgb.class); // homescreen.this.startactivity(intent); } else if (v == contacts) { intent = new intent(homescreen.this, com.themontcalm.droid.lib.activity.contactinfo.class); homescreen.this.startactivity(intent); } else if (v == explore) { intent = new intent(homescreen.this, com.themontcalm.droid.lib.activity.explorepropertyactivity.class); homescreen.this.startactivity(intent); } } }
i doubt
<activity>
tag declaration in manifest file work give try , include in manifest file:
<uses-library android:name="com.themontcalm.droid.lib.activityr" android:required="true" />
Comments
Post a Comment