Quickblox: ClassDefNotFoundError : Smack.smackAndroid in video chat - android

I have used this link to preform videoChat.However, it gives me java.lang.NoClassDefFoundError which cannot locate : com.quickblox.module.chat.smack.SmackAndroid class .I tried changing the preferences of libraries but din't helped.
Here is the log:
03-22 18:14:21.476: I/dalvikvm(9908): Could not find method com.quickblox.module.chat.smack.SmackAndroid.init, referenced from method com.quickblox.videochatsample.ui.App.onCreate
03-22 18:14:21.476: W/dalvikvm(9908): VFY: unable to resolve static method 50: Lcom/quickblox/module/chat/smack/SmackAndroid;.init (Landroid/content/Context;)Lcom/quickblox/module/chat/smack/SmackAndroid;
03-22 18:14:21.476: D/dalvikvm(9908): VFY: replacing opcode 0x71 at 0x0003
03-22 18:14:21.481: D/AndroidRuntime(9908): Shutting down VM
03-22 18:14:21.481: W/dalvikvm(9908): threadid=1: thread exiting with uncaught exception (group=0x41927700)
03-22 18:14:21.486: E/AndroidRuntime(9908): FATAL EXCEPTION: main
03-22 18:14:21.486: E/AndroidRuntime(9908): java.lang.NoClassDefFoundError: com.quickblox.module.chat.smack.SmackAndroid
03-22 18:14:21.486: E/AndroidRuntime(9908): at com.quickblox.videochatsample.ui.App.onCreate(App.java:13)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4684)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.app.ActivityThread.access$1400(ActivityThread.java:159)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.os.Handler.dispatchMessage(Handler.java:99)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.os.Looper.loop(Looper.java:137)
03-22 18:14:21.486: E/AndroidRuntime(9908): at android.app.ActivityThread.main(ActivityThread.java:5419)
03-22 18:14:21.486: E/AndroidRuntime(9908): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 18:14:21.486: E/AndroidRuntime(9908): at java.lang.reflect.Method.invoke(Method.java:525)
03-22 18:14:21.486: E/AndroidRuntime(9908): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
03-22 18:14:21.486: E/AndroidRuntime(9908): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
03-22 18:14:21.486: E/AndroidRuntime(9908): at dalvik.system.NativeStart.main(Native Method)

go to build path and click on add external jar and add quickbox-android-1.2.2.jar
and go to Order and Export tab and check jarfile checkbox.and clean and rebuild project thats it...

Related

android application stopped unexpectedly emulator

Couldn't able to find the error. Logcat Provided
03-22 00:08:15.677: E/dalvikvm(275): Could not find class 'net.sourceforge.jeval.Evaluator', referenced from method com.math.Mainactivitycalculator.onCreate
03-22 00:08:15.927: E/AndroidRuntime(275): FATAL EXCEPTION: main
03-22 00:08:15.927: E/AndroidRuntime(275): java.lang.NoClassDefFoundError: net.sourceforge.jeval.Evaluator
03-22 00:08:15.927: E/AndroidRuntime(275): at com.dbl.dothemath.Mainactivitycalculator.onCreate(Mainactivitycalculator.java:76)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.os.Handler.dispatchMessage(Handler.java:99)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.os.Looper.loop(Looper.java:123)
03-22 00:08:15.927: E/AndroidRuntime(275): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-22 00:08:15.927: E/AndroidRuntime(275): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 00:08:15.927: E/AndroidRuntime(275): at java.lang.reflect.Method.invoke(Method.java:521)
03-22 00:08:15.927: E/AndroidRuntime(275): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-22 00:08:15.927: E/AndroidRuntime(275): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-22 00:08:15.927: E/AndroidRuntime(275): at dalvik.system.NativeStart.main(Native Method)
mathematical Expression involving numbers.
Numbers are treated as doubles, so resulting numbers will contain at least one decimal place.
string String can also be added together, compared, etc...
Boolean Expression that evaluate to true (1.0) and false (0.0).
functional Custom functions can be created or there are many Math and String functions that JEval supplies with this class.

alfresco's android sdk samples crashes when i enter the correct settings of the server

i am testing the sdk samples app from alfresco android sdk under a AVD, i am using alfresco community edition 4.2, when i enter a wrong Hostname i get the message "failed to log in. please check your settings", but when i enter the correct host name, the app crashes and i get the message "Unfortunately, SDK Samples has stopped." then it restarts...
there is this one time, i entered the correct host name and the app connected to the alfresco server without any problem, but when i tried a second time the problem persists
any idea what could be the problem?!!
LogCat
03-22 19:33:53.584: I/dalvikvm-heap(811): Grow heap (frag case) to 7.083MB for 108752-byte allocation
03-22 19:33:53.624: D/dalvikvm(811): GC_FOR_ALLOC freed 53K, 10% free 7153K/7879K, paused 37ms, total 37ms
03-22 19:33:53.814: D/dalvikvm(811): GC_CONCURRENT freed 434K, 9% free 7216K/7879K, paused 15ms+28ms, total 96ms
03-22 19:33:53.844: D/AndroidRuntime(811): Shutting down VM
03-22 19:33:53.844: W/dalvikvm(811): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
03-22 19:33:53.894: E/AndroidRuntime(811): FATAL EXCEPTION: main
03-22 19:33:53.894: E/AndroidRuntime(811): java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = org.apache.chemistry.opencmis.client.runtime.SessionImpl)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Parcel.writeSerializable(Parcel.java:1279)
03-22 19:33:53.894: E/AndroidRuntime(811): at org.alfresco.mobile.android.api.session.impl.RepositorySessionImpl.writeToParcel(RepositorySessionImpl.java:219)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Parcel.writeParcelable(Parcel.java:1254)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Parcel.writeValue(Parcel.java:1173)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Parcel.writeMapInternal(Parcel.java:591)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Bundle.writeToParcel(Bundle.java:1619)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Parcel.writeBundle(Parcel.java:605)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.content.Intent.writeToParcel(Intent.java:6470)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1741)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.Activity.startActivityForResult(Activity.java:3351)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.Activity.startActivityForResult(Activity.java:3312)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.Activity.startActivity(Activity.java:3522)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.Activity.startActivity(Activity.java:3490)
03-22 19:33:53.894: E/AndroidRuntime(811): at org.alfresco.mobile.android.samples.activity.SessionLoaderCallback.onLoadFinished(SessionLoaderCallback.java:191)
03-22 19:33:53.894: E/AndroidRuntime(811): at org.alfresco.mobile.android.samples.activity.SessionLoaderCallback.onLoadFinished(SessionLoaderCallback.java:1)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:482)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:450)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.content.Loader.deliverResult(Loader.java:143)
03-22 19:33:53.894: E/AndroidRuntime(811): at org.alfresco.mobile.android.api.asynchronous.AbstractBaseLoader.deliverResult(AbstractBaseLoader.java:65)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.content.AsyncTaskLoader.dispatchOnLoadComplete(AsyncTaskLoader.java:254)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.content.AsyncTaskLoader$LoadTask.onPostExecute(AsyncTaskLoader.java:91)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.AsyncTask.finish(AsyncTask.java:631)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.AsyncTask.access$600(AsyncTask.java:177)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Handler.dispatchMessage(Handler.java:99)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.os.Looper.loop(Looper.java:137)
03-22 19:33:53.894: E/AndroidRuntime(811): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.lang.reflect.Method.invoke(Method.java:511)
03-22 19:33:53.894: E/AndroidRuntime(811): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-22 19:33:53.894: E/AndroidRuntime(811): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-22 19:33:53.894: E/AndroidRuntime(811): at dalvik.system.NativeStart.main(Native Method)
03-22 19:33:53.894: E/AndroidRuntime(811): Caused by: java.io.NotSerializableException: org.alfresco.cmis.client.impl.AlfrescoAspectsImpl
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1364)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:979)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:368)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1074)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.util.HashMap.writeObject(HashMap.java:1013)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.lang.reflect.Method.invoke(Method.java:511)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1053)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1404)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
03-22 19:33:53.894: E/AndroidRuntime(811): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)
03-22 19:33:53.894: E/AndroidRuntime(811): at org.apache.chemistry.opencmis.client.runtime.cache.CacheImpl$CacheItem.writeObject(Cach
03-22 19:33:57.344: I/Process(811): Sending signal. PID: 811 SIG: 9
03-22 19:33:57.874: E/Trace(867): error opening trace file: No such file or directory (2)
03-22 19:33:58.514: D/dalvikvm(867): GC_CONCURRENT freed 219K, 5% free 6215K/6535K, paused 16ms+4ms, total 80ms
03-22 19:33:58.564: I/Choreographer(867): Skipped 35 frames! The application may be doing too much work on its main thread.
03-22 19:33:58.574: D/gralloc_goldfish(867): Emulator without GPU emulation detected.
03-22 19:33:58.695: I/Choreographer(867): Skipped 51 frames! The application may be doing too much work on its main thread.
This error was due to a bug inside a dependency used by Alfresco Mobile SDK Sample.
This error has been fixed by the release of alfresco-opencmis-extension 0.7-ANDROID and in general by the release of Alfresco Mobile SDK 1.3.1.

Error trying to change password hint font

I'm trying to follow the advice from this post:
But when I run this code, my program crashes. Here is my code:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Change the font for the password hint to match that of the
* user name field */
EditText pw = (EditText) findViewById(R.id.password);
pw.setTypeface(Typeface.DEFAULT); //<---Crashes on this line
pw.setTransformationMethod(new PasswordTransformationMethod());
setContentView(R.layout.activity_main);
}
Here is the XML for this object:
<EditText
android:id="#+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/userName"
android:layout_alignRight="#+id/appName"
android:layout_below="#+id/userName"
android:layout_marginTop="14dp"
android:ems="10"
android:hint="#string/password"
android:inputType="textPassword" />
And finally, here is the LogCat output where I can see the error:
05-09 00:30:21.408: E/Trace(16987): error opening trace file: No such
file or directory (2) 05-09 00:30:21.918: D/AndroidRuntime(16987):
Shutting down VM 05-09 00:30:21.918: W/dalvikvm(16987): threadid=1:
thread exiting with uncaught exception (group=0x40a71930) 05-09
00:30:21.978: E/AndroidRuntime(16987): FATAL EXCEPTION: main 05-09
00:30:21.978: E/AndroidRuntime(16987): java.lang.RuntimeException:
Unable to start activity
ComponentInfo{com.mobilenicity.gen_co_event_marketing_app/com.mobilenicity.gen_co_event_marketing_app.MainActivity}:
java.lang.NullPointerException 05-09 00:30:21.978:
E/AndroidRuntime(16987): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
05-09 00:30:21.978: E/AndroidRuntime(16987): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
05-09 00:30:21.978: E/AndroidRuntime(16987): at
android.app.ActivityThread.access$600(ActivityThread.java:141) 05-09
00:30:21.978: E/AndroidRuntime(16987): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
05-09 00:30:21.978: E/AndroidRuntime(16987): at
android.os.Handler.dispatchMessage(Handler.java:99) 05-09
00:30:21.978: E/AndroidRuntime(16987): at
android.os.Looper.loop(Looper.java:137) 05-09 00:30:21.978:
E/AndroidRuntime(16987): at
android.app.ActivityThread.main(ActivityThread.java:5041) 05-09
00:30:21.978: E/AndroidRuntime(16987): at
java.lang.reflect.Method.invokeNative(Native Method) 05-09
00:30:21.978: E/AndroidRuntime(16987): at
java.lang.reflect.Method.invoke(Method.java:511) 05-09 00:30:21.978:
E/AndroidRuntime(16987): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-09 00:30:21.978: E/AndroidRuntime(16987): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 05-09
00:30:21.978: E/AndroidRuntime(16987): at
dalvik.system.NativeStart.main(Native Method) 05-09 00:30:21.978:
E/AndroidRuntime(16987): Caused by: java.lang.NullPointerException
05-09 00:30:21.978: E/AndroidRuntime(16987): at
com.mobilenicity.gen_co_event_marketing_app.MainActivity.onCreate(MainActivity.java:26)
05-09 00:30:21.978: E/AndroidRuntime(16987): at
android.app.Activity.performCreate(Activity.java:5104) 05-09
00:30:21.978: E/AndroidRuntime(16987): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
05-09 00:30:21.978: E/AndroidRuntime(16987): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
05-09 00:30:21.978: E/AndroidRuntime(16987): ... 11 more
Can't figure out what is going wrong. Can anybody see it? Thanks!
Change the call of setContentView(R.layout.activity_main);
Call it just after super.onCreate(savedInstanceState);
When you're doing EditText pw = (EditText) findViewById(R.id.password);, findViewById "can't retrieve" the EditText that you have defined in your layout (because you call setContentView after) so findViewById returns null and when you're doing pw.setTypeface(Typeface.DEFAULT); it throws a NPE because pw is null.

Android setdrawable from another class

Here's my code. I am trying to set background of a linear layout. But this xml (rowback) is not my main activity content, so gives errors. how can I set some XML from the class which doesn't have that XML in its content?
setContentView(R.layout.activity_quick_search_products);
...
rowb = (LinearLayout)findViewById(R.id.rowback);
...
final Drawable d = getResources().getDrawable(R.drawable.denemebut3);
d.setAlpha(100);
rowb.setBackgroundDrawable(d);
Logcat:
03-30 02:52:50.822: D/AndroidRuntime(14677): Shutting down VM
03-30 02:52:50.822: W/dalvikvm(14677): threadid=1: thread exiting with uncaught exception (group=0x40c841f8)
03-30 02:52:50.822: E/AndroidRuntime(14677): FATAL EXCEPTION: main
03-30 02:52:50.822: E/AndroidRuntime(14677): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vitrinn/com.vitrinn.QuickSearchProducts}: java.lang.NullPointerException
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1968)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.ActivityThread.access$600(ActivityThread.java:127)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.os.Handler.dispatchMessage(Handler.java:99)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.os.Looper.loop(Looper.java:137)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.ActivityThread.main(ActivityThread.java:4507)
03-30 02:52:50.822: E/AndroidRuntime(14677): at java.lang.reflect.Method.invokeNative(Native Method)
03-30 02:52:50.822: E/AndroidRuntime(14677): at java.lang.reflect.Method.invoke(Method.java:511)
03-30 02:52:50.822: E/AndroidRuntime(14677): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:978)
03-30 02:52:50.822: E/AndroidRuntime(14677): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
03-30 02:52:50.822: E/AndroidRuntime(14677): at dalvik.system.NativeStart.main(Native Method)
03-30 02:52:50.822: E/AndroidRuntime(14677): Caused by: java.lang.NullPointerException
03-30 02:52:50.822: E/AndroidRuntime(14677): at com.vitrinn.QuickSearchProducts.onCreate(QuickSearchProducts.java:69)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.Activity.performCreate(Activity.java:4469)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
03-30 02:52:50.822: E/AndroidRuntime(14677): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
03-30 02:52:50.822: E/AndroidRuntime(14677): ... 11 more
If R.id.rowback doesn't belong to your main activity xml resource, then you should inflate that resource manually using:
LinearLayout rowb = (LinearLayout) getLayoutInflater().inflate(XML file that contains R.id.rowback, null);
then you can safely do
rowb.setBackgroundDrawable(d);
As an extra, if you have nested elements in rowback then you can invoke:
rowb.findViewById(R.id.Something) safely.
Or if your class is not exteding from any Activity, you can always receive a Context object in its constructor, and then use
LayoutInflater.from(context)
to get a LayoutInflater object so you can inflate any XML resource you need that is not actually in your main content.
Hope this clarifies...

Android onDestroy Error

In my app there is one activity I have where I call onDestroy and inside it I have the following:
#Override
public void onDestroy()
{
productAdapter.imageLoader.stopThread();
lvProducts.setAdapter(null);
super.onDestroy();
}
productAdapter is my ListView adapter and I am using the fedorvlasov lazy load functionality.
The issue is, when I leave the app for a LONG time and come back, I try to access this activity from the main activity and I get the following:
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): FATAL EXCEPTION: main
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): java.lang.RuntimeException: Unable to destroy activity {com.MyApp/com.MyApp.Products}: java.lang.NullPointerException
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3081)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3146)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.app.ActivityThread.access$2100(ActivityThread.java:132)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1071)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.os.Handler.dispatchMessage(Handler.java:99)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.os.Looper.loop(Looper.java:150)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.app.ActivityThread.main(ActivityThread.java:4263)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at java.lang.reflect.Method.invoke(Method.java:507)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at dalvik.system.NativeStart.main(Native Method)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): Caused by: java.lang.NullPointerException
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at com.MyApp.Productss.onDestroy(DailyDeals.java:678)
03-22 09:15:17.684: ERROR/AndroidRuntime(28442): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3063)
The thing is, I dont know how to reproduce this because it only happens if I leave the app for a long time and come back. Its almost like there is an Android timeout that says after this many hours, cause app to start over.
The system will kill your application whenever it needs the resources to use for something else. This is why when you come back after a long time it is no longer running.
why do you have this line?
lvProducts.setAdapter(null);
I think that is what is giving you a null pointer. It isn't liking that you are trying to set it with a null adapter. Try removing this line
Also just to be sure, which line is 678?

Categories

Resources