Hi!
I'm trying to do a single query on Facebook. To do that, I'm using
FBRocket ( http://xeomax.net/fbrocket/ ).
Everything worked fine when the code was located in my main Activity.
I however moved it to another class then:
package com.example.helloandroid;
import it.polimi.elet.contextaddict.microjena.rdf.model.Model;
import it.polimi.elet.contextaddict.microjena.rdf.model.Resource;
import net.xeomax.FBRocket.FBRocket;
import net.xeomax.FBRocket.Facebook;
import net.xeomax.FBRocket.LoginListener;
import net.xeomax.FBRocket.ServerErrorException;
import android.app.Activity;
import android.util.Log;
public class DPFacebook implements IBasicDataProvider, LoginListener {
FBRocket fbRocket;
Facebook fb;
Activity callingActivity;
public DPFacebook(Activity activity) {
fbRocket = new FBRocket(activity, appname, key);
callingActivity = activity;
}
@Override
public void updateContext(Model contextModel, Resource
currentContext) {
if (fbRocket.existsSavedFacebook()) {
fbRocket.loadFacebook();
} else {
fbRocket.login(this, R.layout.main);
}
}
@Override
public void updateData(Model targetModel) {
// TODO Auto-generated method stub
}
@Override
public void onLoginFail() {
fbRocket.displayToast("Login failed!");
fbRocket.login(this, R.layout.main);
}
@Override
public void onLoginSuccess(Facebook arg0) {
fbRocket.displayToast("Login success!");
String query = "SELECT uid FROM user WHERE name=\"John Doe\"";
String result;
try {
result = arg0.fqlQuery(query);
if (result != "")
Log.v("FB", result);
} catch (ServerErrorException e) {
// Check if the exception was caused by not being
logged-in:
if (e.notLoggedIn()) {
// ...if it was, then login again:
fbRocket.login(this, R.layout.main);
} else {
System.out.println(e);
e.printStackTrace();
}
}
}
}
However, when I reach the login(), nothing happens. When I had the
code in the main activity, it opened the Facebook Connect login
interface in a browser. Now I don't get any errors, exceptions or
anything.
Is is possible that my class lacks a permission to open a browser or
something?
Thanks for your help,
Flo
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en