Reputation: 402
I have this activity with an edittext
that the user can write a short text inside, then when done a new activity opens up with a listview
that fetches facebook friends, i bring the text like this:
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
EditText etLocation = (EditText) findViewById(R.id.editTextNew);
Intent intent = new Intent(NewTextActivity.this, SendActivity.class);
intent.putExtra("location", etLocation.getText().toString());
startActivity(intent);
};
}
This is the listvew
:
final OnFriendsListener mOnFriendsListener = new OnFriendsListener() {
@Override
public void onComplete(List<Profile> friends) {
runOnUiThread(new Runnable() {
@Override
public void run() {
mSpinner.setVisibility(View.GONE);
mSpinner.clearAnimation();
}
});
// populate list
List<String> values = new ArrayList<String>();
for (Profile profile : friends) {
//profile.getInstalled();
values.add(profile.getName());
}
My next goal is to be able to make this text be sent to a friend within this listview
, and then be recieved by that friend inside the app, and not on the actual facebook chat, but i can't really find any examples or instructions on how to do this with the facebook sdk, any tips on how i could go from here or links i could check out? :)
Upvotes: 0
Views: 114
Reputation: 1017
You would have to keep a track of users in your own DB using their unique facebook ids. Then you would incorporate your own "chat" protocol, Such as XMPP, check this out for further reading: Android and XMPP.
You can't just send a message using the facebook SDK is what I'm trying to say ;)
Upvotes: 2