2016-10-28 1 views
0

공유 아이콘을 유지하면서 메시징 앱이있는 작은 상자를 제거하려면 어떻게해야합니까? 당신이 최근에 공유 응용 프로그램을 표시 할 수없는 경우가장 최근의 공유 응용 프로그램 제거

Share intent with most recent app

<item 
    android:id="@+id/share" 
    app:actionProviderClass="android.support.v7.widget.ShareActionProvider" 
    android:title="share" 
    app:showAsAction="always" /> 

답변

1

다음 ShareActionprovider를 제거합니다. 을 선택하고 메뉴에 아이콘을 추가하고 다음과 같이 공유 작업을 처리하십시오.

Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); 
sharingIntent.setType("text/plain"); 
String shareBody = "Here is the share content body"; 
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here"); 
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody); 
startActivity(Intent.createChooser(sharingIntent, "Share via")); 
관련 문제