Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19504] Android: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-09-14T17:05:49.000+0000
Affected Version/sRelease 5.0.0
Fix Version/sRelease 5.0.0
ComponentsAndroid
Labelsandroid
ReporterBen Bahrenburg
AssigneeAshraf Abu
Created2015-09-13T04:16:22.000+0000
Updated2015-09-15T00:36:09.000+0000

Description

If you follow the actionbar example from the documentation http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.ActionBar you will get the following error. Uncaught Error: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity

Comments

  1. Ingo Muschenetz 2015-09-13

    Hi [~ben.bahrenburg@gmail.com] thanks for the report. Note I made minor updates to the ticket to better reflect the error, and please only set severity (i.e. blocker), not priority. [~hpham] [~cng] [~msamah], please review ASAP.
  2. Ashraf Abu 2015-09-14

  3. Ashraf Abu 2015-09-14

    This was already reverted by PR https://github.com/appcelerator/titanium_mobile/pull/7149 Confirmed this with the current 5_0_X branch with the test code:-
       var win = Ti.UI.createWindow({
           title: "Old Title"
       });
       var actionBar;
        
       win.addEventListener("open", function() {
           if (Ti.Platform.osname === "android") {
               if (! win.activity) {
                   Ti.API.error("Can't access action bar on a lightweight window.");
               } else {
                   actionBar = win.activity.actionBar;
                   if (actionBar) {
                       actionBar.title = "New Title";
                   }
               }
           }
       });
        
       win.open();
       
    [~ben.bahrenburg@gmail.com], Thanks for the report.
  4. Ingo Muschenetz 2015-09-14

    [~msamah] thanks. Reminder to use "Fixed" and not "Done"
  5. Lokesh Choudhary 2015-09-15

    Verified the fix. The app with action bar builds & displays the action bar successfully with build 5.0.0.v20150914163105. Closing. Environment: Appc Studio : 4.3.0.201509140942 Ti SDK : 5.0.0.v20150914163105 Ti CLI : 5.0.3 Alloy : 1.7.7 MAC Yosemite : 10.10.4 Appc NPM : 4.2.0-8 Appc CLI : 5.0.0-51 Node: v0.10.37 Nexus 5 - Android 5.1.1

JSON Source