1

I would like to create a button in my app such that upon clicking facebook and twitter options would appear and user can immediately share my app. Right now my codes are as below but it still doesn't work. Anyone knows the reason? I'm guessing I need to declare it on manifest but how do I go about?

public Intent onClick(View arg0) {
    Intent normalIntent = new Intent(Intent.ACTION_SEND);
    normalIntent.setType("text/plain");   
    normalIntent.putExtra(Intent.EXTRA_SUBJECT, subject);   
    normalIntent.putExtra(Intent.EXTRA_TEXT, content);

    return Intent.createChooser(normalIntent, "Share");
  • possible duplicate of [Sharing to facebook, twitter via share intent android](http://stackoverflow.com/questions/13286358/sharing-to-facebook-twitter-via-share-intent-android) – corsair992 Jan 05 '14 at 09:39
  • @corsair992 i tried using those codes as well but to no avail. my app keeps crashing. – user3150968 Jan 05 '14 at 14:36
  • What error is shown in the logcat? – corsair992 Jan 05 '14 at 14:39
  • FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.miyoc/com.example.miyoc.MemberMain}: java.lang.IllegalStateException: Couldn't read row 0, col 6 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. it says this @corsair992 – user3150968 Jan 07 '14 at 11:54
  • This is some other unrelated issue in your code. – corsair992 Jan 07 '14 at 12:54

0 Answers0