本文實例講述了Android開發中應用程序分享功能。分享給大家供大家參考,具體如下:
Intent shareIntent = new Intent();shareIntent.setAction(Intent.ACTION_SEND);//設置類型shareIntent.setType("text/plain");//設置分享的主題shareIntent.putExtra("android.intent.extra.SUBJECT", "分享");shareIntent.putExtra(Intent.EXTRA_TEXT, "推薦你使用一個程序:"+infos.get(position).getAppName());shareIntent = Intent.createChooser(shareIntent, "分享");startActivity(shareIntent);Log.i(TAG, infos.get(position)+"分享");break;更多關于Android相關內容感興趣的讀者可查看本站專題:《Android開發入門與進階教程》、《Android通信方式總結》、《Android基本組件用法總結》、《Android視圖View技巧總結》、《Android布局layout技巧總結》及《Android控件用法總結》
希望本文所述對大家Android程序設計有所幫助。
新聞熱點
疑難解答
圖片精選