0

I'm going through this Udacity Android course, and I'm trying to add a share button to the action bar. I followed all the instructions, and for some reason I'm seeing 2 share buttons! Here is the code on github https://github.com/sayo9394/Sunshine

enter image description here

here is the diff between the 2 commits that resulted with the 2 share buttons.

https://github.com/sayo9394/Sunshine/compare/master@%7B1Day%7D...master

sayo9394
  • 435
  • 8
  • 18
  • 1
    Can it happen that you inflate the menu twice: in Activity and in Fragment? – Egor Sep 12 '15 at 07:09
  • check https://github.com/sayo9394/Sunshine/blob/master/app/src/main/java/com/sayo/android/sunshine/ForecastFragment.java – Naveen Tamrakar Sep 12 '15 at 07:14
  • please check dobackground – Naveen Tamrakar Sep 12 '15 at 07:14
  • @Egor I've checked if i'm inflating the menu twice. In the Activity i'm inflating a detail.xml which has a Settings options. In the fragment, I'm inflating the detailfragment.xml which has the sharebuttons. – sayo9394 Sep 12 '15 at 07:33
  • @NaveenTamrakar, I don't understand what the doInBackGround in the ForecastFragment has anything to do with the DetailActivityFragment where the menu is being inflated. – sayo9394 Sep 12 '15 at 10:07

1 Answers1

0

The issue was in the layout activity_detail.xml. I had it declared as a Fragment.

Changing it to a FrameLayout did the trick.

Thanks guys.

sayo9394
  • 435
  • 8
  • 18