Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26989] Android: TableView having SearchBar/SearchView will crash upon resume while "Don't keep activities" is enabled as of 7.2.1

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-04-29T13:42:30.000+0000
Affected Version/sRelease 7.2.1
Fix Version/sRelease 8.0.1
ComponentsAndroid
LabelsSearchBar, TableView, android, engSchedule, regression, searchview
ReporterJoshua Quick
AssigneeJoshua Quick
Created2019-04-20T02:10:02.000+0000
Updated2019-04-29T13:42:30.000+0000

Description

*Summary:* If Android "Developer Options" setting "Don't keep activities" is enabled, then a TableView having a SearchBar or SearchView assigned to its "search" property will cause the app to crash after homing-out of the app and then resuming it. This regression was introduced as of 7.2.1. ListView does not have this problem. This is only a regression with TableView. *Steps to reproduce:*

Go to the Android device's main "Settings" screen.

Tap on "System" under "Settings.

Tap on "Developer options" under "System" settings.

Enable "Don't keep activities", which should be near the bottom of the list.

Build and run the below code on the above Android device.

Wait for the app to launch.

Tap on the Android "Home" button.

Resume the app.

Notice that the app crashes upon resume.

var window = Ti.UI.createWindow();
var tableView = Ti.UI.createTableView({
	data: [],
//	search: Ti.UI.createSearchBar({ showCancel: true, width: Ti.UI.FILL }),
	search: Ti.UI.Android.createSearchView(),
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
});
window.add(tableView);
window.open();
*Result:*
[ERROR] TiExceptionHandler: (main) [6143,6143] Attempt to invoke virtual method 'java.lang.Object org.appcelerator.kroll.KrollDict.get(java.lang.Object)' on a null object reference
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.view.TiUIView.composeContentDescription(TiUIView.java:2188)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.view.TiUIView.applyContentDescription(TiUIView.java:2162)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.view.TiUIView.applyAccessibilityProperties(TiUIView.java:2225)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.view.TiUIView.setNativeView(TiUIView.java:351)
[ERROR] TiExceptionHandler:     ti.modules.titanium.ui.widget.searchview.TiUISearchView.<init>(TiUISearchView.java:44)
[ERROR] TiExceptionHandler:     ti.modules.titanium.ui.android.SearchViewProxy.createView(SearchViewProxy.java:40)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:490)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] TiExceptionHandler:     ti.modules.titanium.ui.widget.TiUITableView.processProperties(TiUITableView.java:154)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1296)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:505)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:512)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:462)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:601)
[ERROR] TiExceptionHandler:     ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:292)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:624)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:767)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21)
[ERROR] TiExceptionHandler:     android.app.Activity.performCreate(Activity.java:7136)
[ERROR] TiExceptionHandler:     android.app.Activity.performCreate(Activity.java:7127)
[ERROR] TiExceptionHandler:     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
[ERROR] TiExceptionHandler:     android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
[ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
[ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
[ERROR] TiExceptionHandler:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
[ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:106)
[ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:193)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:6669)
[ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiExceptionHandler:     com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

Comments

  1. Joshua Quick 2019-04-20

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10829
  2. Joshua Quick 2019-04-26

    PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10868
  3. Lokesh Choudhary 2019-04-26

    FR passed PR merged.
  4. Samir Mohammed 2019-04-29

    Closing ticket, fix verified in SDK version 8.0.1.v20190426162041 and SDK version 8.1.0.v20190426222341 Test and other information can be found at: Master : https://github.com/appcelerator/titanium_mobile/pull/10829 8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10868

JSON Source