1
我很新的android和facebook plugin.trying按照facebook
开发人员网站中提到的步骤操作。 https://developers.facebook.com/docs/android/scrumptious/authenticate/
转到步骤3android facebook UserSettingsFragment无法正常工作
I followed it without missing any steps.
However, I do not see a menu at the bottom when i am logged in.Any help?
Below is the snippet of important codes and xml.
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// only add the menu when the selection fragment is showing
if (fragments[SELECTION].isVisible()) {
if (menu.size() == 0) {
Log.d("onPrepareOptionsMenu","Yes");
settings = menu.add(R.string.settings);
}
return true;
} else {
menu.clear();
settings = null;
}
return false;
}
继main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment android:name="com.punit.xxx.SelectionFragment"
android:id="@+id/selectionFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment android:name="com.punit.xxx.SplashFragment"
android:id="@+id/splashFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment android:name="com.facebook.widget.UserSettingsFragment"
android:id="@+id/userSettingsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
我试图把一些日志,发现OnPrepareotionsMenu永远不会被调用。
是应该说android而不是MyNews? – user2456977
并且您是否在布局xml或drawable中添加了- ?或者别的地方? –
user2456977