Skip to main content
adicionou 84 caracteres ao conteúdo
Fonte Link

Tente da seguinte forma:

XML

<ListView
    android:id="@+id/list_exercicios"
    android:scrollbars="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true" />



<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    android:clickable="true"
    android:id="@+id/fab"
    android:src="@mipmap/ic_icon"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    />

Activity

public class SuaActivity extends AppCompatActivity {

   private FloatingActionButton fab;
    private ListView listaExercicio;

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.seu_xml);
         // Referencia da Lista
        listaExercicio = ListView.class.cast(findViewById(R.id.list_exercicios));
         // Referencia do Floating Action Button
        fab = FloatingActionButton.class.cast(findViewById(R.id.fab));
    }

}

Tente da seguinte forma:

XML

<ListView
    android:id="@+id/list_exercicios"
    android:scrollbars="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true" />



<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    android:clickable="true"
    android:id="@+id/fab"
    android:src="@mipmap/ic_icon"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    />

Activity

public class SuaActivity extends AppCompatActivity {

   private FloatingActionButton fab;
    private ListView listaExercicio;

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.seu_xml);

        listaExercicio = ListView.class.cast(findViewById(R.id.list_exercicios));
        fab = FloatingActionButton.class.cast(findViewById(R.id.fab));
    }

}

Tente da seguinte forma:

XML

<ListView
    android:id="@+id/list_exercicios"
    android:scrollbars="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true" />



<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    android:clickable="true"
    android:id="@+id/fab"
    android:src="@mipmap/ic_icon"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    />

Activity

public class SuaActivity extends AppCompatActivity {

   private FloatingActionButton fab;
    private ListView listaExercicio;

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.seu_xml);
         // Referencia da Lista
        listaExercicio = ListView.class.cast(findViewById(R.id.list_exercicios));
         // Referencia do Floating Action Button
        fab = FloatingActionButton.class.cast(findViewById(R.id.fab));
    }

}
Fonte Link

Tente da seguinte forma:

XML

<ListView
    android:id="@+id/list_exercicios"
    android:scrollbars="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentBottom="true" />



<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    android:clickable="true"
    android:id="@+id/fab"
    android:src="@mipmap/ic_icon"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    />

Activity

public class SuaActivity extends AppCompatActivity {

   private FloatingActionButton fab;
    private ListView listaExercicio;

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.seu_xml);

        listaExercicio = ListView.class.cast(findViewById(R.id.list_exercicios));
        fab = FloatingActionButton.class.cast(findViewById(R.id.fab));
    }

}