Twitter Facebook Delicious Digg Stumbleupon Favorites More

Saturday 18 August 2018

floating action with share option


  1. 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'

  1. 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"));

            }
        });
  1. 3
Share:

0 comments:

Post a Comment

Search This Blog

Popular Posts

Pages

how to make crores from 1 lakh in stock markets in 1 year

how to make crores from 1 lakh in stock markets in 1 year

Blogger Tutorials

Blogger Templates

Sample Text

Copyright © ANDROID TUTORIAL CODE | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com & Distributed By Protemplateslab