You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You got this error due to the fact, that you have'nt defined a layout for the card you want to add to the MaterialListView.
Cardcard = newCard.Builder(MainActivity.this)
.setTag("BASIC_IMAGE_BUTTONS_CARD")
.withProvider(newCardProvider())
.setLayout(...) // TODO: Here comes your R.layout.xyz (for example: R.layout.material_basic_image_buttons_card_layout)
.setTitle("I'm new")
.setDescription("I've been generated on runtime!")
.setDrawable(R.drawable.myimage)
.endConfig()
.build();
i got this error when i try to run code "android.content.res.Resources$NotFoundException: Resource ID #0x0" any idea why?
here is my .xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
here is my main activity
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
MaterialListView mListView = (MaterialListView) findViewById(R.id.material_listview);
Card card = new Card.Builder(MainActivity.this)
.setTag("BASIC_IMAGE_BUTTONS_CARD")
.withProvider(new CardProvider<>())
.setTitle("I'm new")
.setDescription("I've been generated on runtime!")
.setDrawable(R.drawable.myimage)
.endConfig()
.build();
mListView.getAdapter().add(card);
}
});
The text was updated successfully, but these errors were encountered: