I've recently updated my app extending Appcompatactivity
in my Activities
. Since then, the Actionbar
is gone when I launch an external library Intent.
For example, I'm using the HockeyApp
SDK to launch their FeedbackActivity
Here is my code:
FeedbackManager.showFeedbackActivity(this, Uri.fromFile(file));
And here a screenshot (you can see the ActionBar
is gone).
It used to work before until I started extending Appcompatactivity.
For the rest of Activities
it works. The ActionBar is gone
only when I launch an external library Intent
.
Any ideas?
First, check your theme it may be like below ("NoActionBar"). Then the action bar is not appearing. If this is your issue. please add an appropriate theme for your application
if your theme is not a problem, you can add below content to your XML file. (add this as a first child of your XML file)
and add below content to your activity on create method
The reason is probably that
FeedbackManager.showFeedbackActivity(this, Uri.fromFile(file))
opens a new FeedbackActivity.class which is subclass of Activity.class instead of AppCompatActivity.class, so it can not show the ActionBar.Here is a linkhttps://stackoverflow.com/questions/30681918/nullpointerexception-with-actionbar-setdisplayhomeasupenabledboolean-on-a-nu
that explains some reasons.