Start a new topic

BasicArchitectActivity , Unable to start activity ComponentInfo

BasicArchitectActivity , Unable to start activity ComponentInfo


Hi again!

Could you please post the complete error message, because it seems that this is merely an excerpt of the whole message and stack trace. Could you also post the file so i can have a look at the line numbers and recheck them with your error message. Generally it seems that there is a problem with the Intent and the content you put into to start the BasicSampleActivity

thx

Markus

Thank you so much for responding :)

Actually I want to unuse the SamplesListActivity and change the folders contained in the assets in the sense that each folder represents  the appropriate images and approriate colors of the directions !! if you understand me so I have now folders : Hotels , Restaurants , Means of transports etc ... wich contains the same of wich is contained in 1_POI$Poi$Data_1_From$WebService of the example .

I sucessufuly recovered the nouns and the urls of these folders and so I passed them(i mean ExtrasKeyActivitytitleString and extras key android worldURl) to the basicArchitectActivity .

In that I think that i will only use the basicArchitectActivity but i have copied all of the activities of the Examples .

the error is :

java.lang.RuntimeException: Unable to start activity ComponentInfo{pack.tunisiatouristicguide/com.wikitude.samples.BasicArchitectActivity}: java.lang.NullPointerException

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)

at android.app.ActivityThread.access$600(ActivityThread.java:140)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.app.ActivityThread.main(ActivityThread.java:4898)

and others .....

 

here Is my code :

/////////////////////////////////////the part in wich the names of folders are listed and the on click //////////////////////////////////////////////////////////////

protected void onListItemClick( ListView l, View v, int position, long id ) {

super.onListItemClick( l, v, position, id );

 

 

final List<SampleMeta> activitiesToLaunch = getActivitiesToLaunch(position);

final String activityTitle = activitiesToLaunch.get(0).categoryId + ". " + activitiesToLaunch.get(0).categoryName.replace("$", " ");

String activityTitles = new String;

String activityUrls = new String;

String activityClasses = new String;

SampleMeta meta = null ;

 

for (int i= 0; i< activitiesToLaunch.size();i++) {

meta = activitiesToLaunch.get(i);

activityTitles = (meta.categoryId + "."  );

 

Log.i(activityTitles, "Le numero .");

Log.i(meta.categoryName, "le nom");

Log.i(meta.path, "le chemin");

 

activityUrls =  (meta.path);}

 

 

 

switch (meta.categoryId) {

case 1:

 

// Iam passing the url statically 

final String className="com.wikitude.samples.BasicArchitectActivity";

 

try {

 

 

final Intent intent2 = new Intent( this, Class.forName( className ) );

Log.i("yesssss8", "wilyeééee");

Log.i(this.getListLabels(), "wilyeééee");

 

intent2.putExtra(EXTRAS_KEY_ACTIVITY_TITLE_STRING, this.getListLabels());

Log.i("yesssss9", "wilyeééee");

Log.i(this.getListLabels(), "wilyeééee");

 

 

//"samples" + File.separator + this.getArchitectWorldUrls() + File.separator + "index.html"

intent2.putExtra(EXTRAS_KEY_ACTIVITY_ARCHITECT_WORLD_URL, "samples"+File.separator+ "1_All$POI$In$Tunisia_"+ File.separator +"index.html");

 

this.startActivity( intent2 );

 

} catch (ClassNotFoundException e) {

// TODO Auto-generated catch block

//e.printStackTrace();

Log.i("yesssss13", "errrrrrrrrrrreur");

 

Toast.makeText( this, className + "nnot defined/accessible", Toast.LENGTH_SHORT ).show();

}

 

 

 

}

 

 

 

Please help and thank you so much for advance !

best regards.

 

Hi there!

Can you give me more specific information about your project setup.

E.g. Have you copied the "BasicArchitectActivity" and other classes into your own project or are you using the existing SDKSamples project. Have you changed the packagename of the project where the classes are?

Apart from that, usually when you have a NullPointerException you should have an information about in which line and in which class the error occurred. Could you post the surrounding lines of where the error occurred, so that I can have a look at them.

Thx,

Markus

Thank you so much for this API , it's magnificiant ,

I am treying to use the samples to load POI depending of their types (restaurant , hotels etc ) and I am based on the examplePOI$poi$Data_1_from$webService , but I am havin a crazy error even that i have charged the 2 Variables of the Basic ArchitectActivity wich are EXTRAS_KEY_ACTIVITY_ARCHITECT_WORLD_URL and EXTRAS_KEY_ACTIVITY_TITLE_STRING sucessufully but when it starts !!

java.lang.RuntimeException: Unable to start activity ComponentInfo{pack.tunisiatouristicguide/com.wikitude.samples.BasicArchitectActivity}: java.lang.NullPointerException

etc...

here is the way I done : 

 

case 1:

final String className="com.wikitude.samples.BasicArchitectActivity";

 

try {

final Intent intent2 = new Intent( this, Class.forName( className ) );

Log.i(this.getListLabels(), "wilyeééee");

 

intent2.putExtra(EXTRAS_KEY_ACTIVITY_TITLE_STRING, this.getListLabels());

 

 

//"samples" + File.separator + this.getArchitectWorldUrls() + File.separator + "index.html"

intent2.putExtra(EXTRAS_KEY_ACTIVITY_ARCHITECT_WORLD_URL, "samples"+File.separator+ "1_All$POI$In$Tunisia_"+ File.separator +"index.html");

 

this.startActivity( intent2 );

 

} catch (ClassNotFoundException e) {

// TODO Auto-generated catch block

//e.printStackTrace();

 

Toast.makeText( this, className + "nnot defined/accessible", Toast.LENGTH_SHORT ).show();

}

 

 

??????????????

What shall I do ? thnx for advance and sorry for english mistakes !
Login or Signup to post a comment