Android Question An error has occurred in sub: 'void android.widget.LinearLayout.SetOrientation(int)'

TheWind777

Active Member
Licensed User
Longtime User
I'm getting a strange error when the App has been dormant for many hours, then restarted.

An error has occurred in sub:
java.lang.NullPointerException Attempt to invoke virtual method 'void android.widget.LinearLayout.setOrientation(int)' on a null object reference Continue?

If you click Yes to continue, it starts the App just fine.


The internet says the function is: "A Layout that arranges its children in a single column or a single row. The direction of the row can be set by calling setOrientation()."


I assume it is occurring when the Layouts are being formed, and a android.widget.LinearLayout.SetOrientation(LinearLayout.HORIZONTAL) or android.widget.LinearLayout.SetOrientation(LinearLayout.VERTICAL) are being performed.

Any ideas what might be causing the problem? Is Android killing either the Service Module or the Main Thread, and then it tries to start with a null reference, or something? If so, how can I ensure this error doesn't occur?

The App, itself, is working perfectly. I made no revisions on any Layout file, recently, that I can think of.

This error started popping-up only yesterday.

I'm sure I could do a Try/Catch on it, if I knew what was happening.

When I go to the Google Play Store to see if anybody is having crashes, it says "Crashes and ANRs - 0"; but that doesn't say they aren't getting the same requester and clicking 'YES' to continue. So, I don't know if the error is just on my Nexus 7 2nd Version.

I am running the new LOLLIPOP 5.0.0 Newest Preview (API 21)

( I suspect it is occurring in the Activity_Resume routine. I am putting Debug Log() scattered through it to tell just where it might be happening.)
 
Last edited:

TheWind777

Active Member
Licensed User
Longtime User
What is anywheresoftware.giuseppe.salvi.toast.ToastMessageShowWrapper ?

I found it.

It was occurring in a Toast Library (ToastMessageShow v1.70). I just reverted to using the regular Toast instead of a colored toast using that Library in that place in the App and the problem went away.

Thanks for looking...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…