0

This is the problem at hand. The app that i was developing worked nicely in an emulator, BlueStack to be more precise. And then when i run the app in my android device lenovo s650 4.4.2, the app crashed as soon as it gets into the main menu. And the logcat isn't very helpful because it did not state where the error is on the java file. Here's the logcat and java file

05-04 10:18:35.769 7777-7777/com.cssdecisions.cssSA E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: com.cssdecisions.cssSA, PID: 7777
                                                                      java.lang.NullPointerException
                                                                          at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5093)
                                                                          at android.view.View.sendAccessibilityEventUnchecked(View.java:5074)
                                                                          at android.view.View$SendViewStateChangedAccessibilityEvent.run(View.java:19968)
                                                                          at android.os.Handler.handleCallback(Handler.java:808)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:103)
                                                                          at android.os.Looper.loop(Looper.java:193)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5388)
                                                                          at java.lang.reflect.Method.invokeNative(Native Method)
                                                                          at java.lang.reflect.Method.invoke(Method.java:515)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:655)
                                                                          at dalvik.system.NativeStart.main(Native Method)

For the main menu java file, i cant show it here as it exceeds 30000 lines. So i will just give the link to the file instead.

https://drive.google.com/open?id=0B0c-aT9S66HkejRTU290bzk2eDQ

Thank you in advance for taking your time to help.

UPDATED - Image of the stacktrace

Given are the stacktrace errors:

http://imagizer.imageshack.us/a/img922/5973/6KbwEq.png

ANOTHER UPDATE

The app was tested on another phone, Samsung note 3. And it worked like a charm. But it still does not work on Lenovo s650 and s920. Still couldn't figure out the problem.

  • which version of android support library are you using? – shinilms May 04 '16 at 03:47
  • Is this the whole error you got...? I mean usually there will be a line after this "caused by ....." like that.. Please check and provide the full error trace if there is any – Akhil Soman May 04 '16 at 05:16
  • there is nothing. this is the full error that i got. it is not caused by anything, and that is what bothering me. :/ – Shaqimi Yusof May 04 '16 at 06:08
  • In your logcat ,above the redlined error, there is another error trace starting with "System.err " in white color. Please post that too. In the image you have provided there are white colored lines in the logcat. That is what i am talking about. – Akhil Soman May 04 '16 at 07:09

2 Answers2

0

Try to Upgrade the Version of Android Support Library from 23.0.1 to 23.3.0.

Jay Rathod
  • 11,131
  • 6
  • 34
  • 58
shinilms
  • 1,494
  • 3
  • 22
  • 35
0

I have found the culprit to all of this. If you were to go and download the source code I have given through the link, you will find that:-

parameter = new String[4];
parameter[0] = dbHelper.getCultureText("WORKORDER");
parameter[1] = dbHelper.getCultureText("REDHDCSE");
parameter[2] = dbHelper.getCultureText("PURCHASEAPPROVAL");
parameter[3] = dbHelper.getCultureText("MESSAGE");

this code initializes the number of and name of multiple linearlayouts later in the code, so parameter[0] will go into linear1.addChild(0), and so on. So here we have 4 rows, and continuing so later in the code, there's these things:-

badgeTask = new BadgeView(MainMenuActivity.this, linear1.getChildAt(0));
badgeLeave = new BadgeView(MainMenuActivity.this, linear1.getChildAt(1));
badgeSales = new BadgeView(MainMenuActivity.this, linear1.getChildAt(2));
badgePurchase = new BadgeView(MainMenuActivity.this, linear1.getChildAt(3));
badgeMessage = new BadgeView(MainMenuActivity.this, linear1.getChildAt(4));

These badgeViews will popup whenever a new data inserted in the database. So as you can see:-

badgeMessage = new BadgeView(MainMenuActivity.this, linear1.getChildAt(4));

badgeMessage is looking for the child at the 5th position in the parent linearLayout, which is not available because the children count we have is only 4. That is where the problem hits. But then again, it bothers me on why didnt the stacktrace points the problem to there?

But then again, thank you to those who helped. Im sorry if this has taken too much of your time.