Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14179] openPreferences rise error when a service is running

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-07-08T21:44:24.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 14 API, Release 3.2.0
ComponentsAndroid
Labelsandroid, preferences, service, supportTeam
ReporterCarter Lathrop
AssigneeHieu Pham
Created2013-06-11T13:00:06.000+0000
Updated2013-10-23T17:07:12.000+0000

Description

The openPreferences rise an error when a service is running and the app was closed and reopened. That is happening in my Alloy app, but can be duplicated on the KitchenSink app. *Steps to duplicate the error on Kitchen Sink*:

Open the app

Start the service (Platform/Android services)

Close the app (back key)

Re open the app

Try to open preferences (Base UI/Preferences)

*A red "Runtime Error" window will popup saying*: *Location*: [14,23] ui/handheld/android/baseui/preferences.js *Message*: Uncaught Error: Java Exception occurred *Source*: Titanium.UI.Android.openPreferences(); *The console will show this*:
W/System.err(  723): java.lang.NullPointerException
W/System.err(  723):    at android.content.ComponentName.<init>(ComponentName.java:75)
W/System.err(  723):    at android.content.Intent.<init>(Intent.java:3004)
W/System.err(  723):    at ti.modules.titanium.ui.android.AndroidModule.openPreferences(AndroidModule.java:101)
W/System.err(  723):    at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
W/System.err(  723):    at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64)
W/System.err(  723):    at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:832)
W/System.err(  723):    at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1056)
W/System.err(  723):    at org.appcelerator.titanium.proxy.MenuItemProxy.handleMessage(MenuItemProxy.java:170)
W/System.err(  723):    at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err(  723):    at android.os.Looper.loop(Looper.java:137)
W/System.err(  723):    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)

Attachments

FileDateSize
logOpenPreferences.txt2013-06-19T17:23:30.000+0000154955

Comments

  1. Carter Lathrop 2013-06-11

    Confirmed bug on 3.2CI, Android 4.1.2, Titanium Studio, build: 3.1.0.201303032333
  2. Hieu Pham 2013-07-03

    Master PR: https://github.com/appcelerator/titanium_mobile/pull/4436
  3. Lokesh Choudhary 2013-10-23

    Verified the fix. Open preferences does not throw any runtime errors. Thus closing. Environment: Appcel Studio : 3.2.0.201310230601 Ti SDK : 3.2.0.v20131022050844 Mac OSX : 10.8.5 CLI - 3.2.0 with hash 72f7426b4ee6c2d2883c666d5b7e03906a16012f Device: Samsung Galaxy S4 running android 4.2.2 App: Kitchensink- 3_1_X

JSON Source