My problem is as follows, create a menu with Material desing and I do not know how to link the url of my profiles to the buttons that are displayed
BELOW I LEAVE MY CODE
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="co.com.canalcnc.menumaterial.MainActivity">
<com.getbase.floatingactionbutton.FloatingActionsMenu
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/multiple_actions"
android:layout_margin="16dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
app:fab_addButtonColorNormal="#0085c3"
app:fab_addButtonColorPressed="#00FF04"
tools:ignore="ExtraText">
<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/action_a"
app:fab_icon="@drawable/facebook"
/>
<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/action_b"
app:fab_icon="@drawable/instagram"
/>
<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/action_c"
app:fab_icon="@drawable/twitter"
/>
</com.getbase.floatingactionbutton.FloatingActionsMenu>
</RelativeLayout>
Here I leave an example assuming that I believe a button similarly, the code is relatively simple but what you have to do to link it is to use your mainactivity to link it because this can not be done only with xml.
public class MainActivity extends AppCompatActivity implements
View.OnClickListener {
private Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn=(Button)findViewById(R.id.boton_navegacion);
btn.setOnClickListener(this);
}
@Override
public void onClick(View v) {
Uri uriUrl = Uri.parse("http://www.facebook.com/");
Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(intent);
}
}
Now here is the button with xml.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<Button
android:id="@+id/boton_navegacion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:text="Navegar" />
</LinearLayout>
If you notice in the code the only thing that happens is that you send to call your xml button from your MainActivity using the ID and the only thing you have to do is put the click event so that when this happens I will send you to the link that you would put inside as I show you in the code.