So I am about to literally start pulling my hair out, I spent ages trying to get this thing to import correctly then when I finally did, turned out that Facebook developer section was broken and a fix was under way. So yeah, I got this far and now I am stumped.
I have my game, this is literally the last thing to go in. So I have been following the guide on the documentation and I am at this stage:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
View gameView = initializeForView(new Game(), config);
// bottomAd = new AdView(this);
// topAd = new AdView(this);
// fullscreenAd = new InterstitialAd(this);
//
// bottomAd.setAdUnitId("ca-app-pub-4184436538256601/8061928372");
// topAd.setAdUnitId("ca-app-pub-4184436538256601/4249007577");
// fullscreenAd.setAdUnitId("ca-app-pub-4184436538256601/9538661572");
//
// bottomAd.setAdSize(AdSize.BANNER);
// topAd.setAdSize(AdSize.BANNER);
layout = new RelativeLayout(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
layout.addView(gameView);
setContentView(layout);
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if(session.isOpened()){
Request.newMeRequest(session, new Request.GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
if(user != null){
textView = (TextView) findViewById(R.id.welcome);
textView.setText("Welcome " + user.getName());
}
}
}).executeAsync();
}
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
}
}
After getting past a null point that kept claiming my applicationid was null (rebooted eclipse), I am not at this stage.
It started once, had shown the facebook page. Now it won’t run at all, not changed anything. No error message, just straight up “Android Appication has stopped working…”
No idea where to go from here, the documentation isn’t helping. Any ideas?
EDIT: Changed executeAndWait to executeASync, still crashes.
EDIT 2 : Yay debugger, right textView is null. I must be missing something in the XML file. (???)