开发者

Intents and sharing my application

I am having a lot of trouble getting my Sharing of my application to work.

public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {        
        case R.id.exit: System.exit(0);
            break;

        case R.id.icontext: String url = "http://www.manaforged.com";
            String shareText = url + "\nCheck this gaming community out!";
            Intent sendIntent = new Intent(Intent.ACTION_SEND);
            sendIntent.setType("plain/text");
            sendIntent.putExtra(Intent.EXTRA_TEXT, shareText);
            startActivity(Intent.createChooser(sendIntent, "Share"));
            break;            
    }
    return true;

I only get 2 options Gmail and some other random thing. I see screen shots of others using roughl开发者_Python百科y the same code with a lot more options. I have facebook app ect installed on my phones. Did the API change and I am viewing old information? I am getting very frustrated with this. Any ideas?


change sendIntent.setType("plain/text") to sendIntent.setType("text/plain") it will solve your problem..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜