Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method supportActionBar for MainActivity #33

Open
andrewhavens opened this issue Jul 21, 2016 · 2 comments
Open

undefined method supportActionBar for MainActivity #33

andrewhavens opened this issue Jul 21, 2016 · 2 comments

Comments

@andrewhavens
Copy link
Collaborator

It seems that the UI::Navigation class is not compatible with whatever version of Android I am using (23?). When I try to set the title that is displayed in the navigation bar, I see this error:

Exception raised: NoMethodError: undefined method `supportActionBar' for #<MainActivity:0x100075>

I noticed that the main activity class generated by the Flow generator looks like this:

class MainActivity < Android::App::Activity

I was able to get it to work with this:

class MainActivity < Android::Support::V7::App::AppCompatActivity

But I'm not sure if that is the right solution to this problem.

@wndxlori
Copy link

I just ran into this same problem. Same fix that @andrewhavens recommended above worked for me, but it seems like there should be a more appropriate bug fix applied to Flow

@lrz
Copy link
Member

lrz commented Nov 1, 2016

This looks like a bug in the template generator indeed, which should use the AppCompat subclass. @andrewhavens as you're a contributor feel free to patch https://github.com/HipByte/Flow/blob/master/template/flow/files/app/android/main_activity.rb#L1 accordingly :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants