Skip to content Skip to sidebar Skip to footer

Problems With Passing Variable Via Intent Between Activities

I want to pass a result between two activities, but somehow its go in some loop or whatever at the this.startActivity(pIntent), then force close. Here is my core code of the first

Solution 1:

You are trying to launch DisplayMessageActivity from within itself, thus creating an infinite "loop". This makes your app run out of memory.

Replace:

Intent pIntent=newIntent(this,DisplayMessageActivity.class);

with:

Intent pIntent=newIntent(this,ScatterGraph.class);

Second argument to Intent(Context, Class<?>) constructor should be the Activity class you wish to launch, not the originating activity.

Post a Comment for "Problems With Passing Variable Via Intent Between Activities"