- 1xml
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="19dp"
android:layout_marginEnd="25dp"
android:clickable="true"
app:fabSize="normal"
app:srcCompat="@drawable/share" />
implementation 'com.android.support:design:27.0.0'
- 2
floatButton = (ImageButton) findViewById(R.id.fab);
floatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
String shareBody="Downdload Love percentage calculator Here https://play.google.com/store/apps/details?id=lovecalculator.lovecalculator";
String shareSub="Downdload Love percentage calculator Here https://play.google.com/store/apps/details?id=lovecalculator.lovecalculator";
i.putExtra(Intent.EXTRA_SUBJECT,shareBody);
i.putExtra(Intent.EXTRA_TEXT,shareSub);
startActivity(Intent.createChooser(i,"SHARE USING"));
}
});
- 3
0 comments:
Post a Comment