Android CardView 实现

Android CardView implementation

我创建了一个具有列表视图的 Android 应用程序。每当单击 an 元素时,它都会将意图传递给 cardview.I 在我的布局文件中有一个卡片视图,并将其用于 listView 中的每个元素。

对于每个列表项,我在 Java 中为 CardView 定义了不同的实现,将意图从一个 java 文件传递​​到另一个文件。 .

这是一个很好的做法,对多个元素以编程方式更改其文本使用单个卡片视图和 Recycler View。我还没有看到有人这样做过。

编辑 @Ankit 类似...

类似

>
<android.support.v7.widget.RecyclerView/>
</LinearLayout>```



**Tutorial page 1**
       ```public class Lesson_Galaxy_One extends AppCompatActivity
{ super.onCreate(savedInstanceState);
        setContentView(R.layout.lesson_galaxy);

}```


**Tutorial 2**
       ```public class Lesson_Galaxy_Two extends AppCompatActivity
{ super.onCreate(savedInstanceState);
        setContentView(R.layout.lesson_galaxy);

}```

**Tutorial 3**
       ```public class Lesson_Galaxy_Three extends AppCompatActivity
{ super.onCreate(savedInstanceState);
        setContentView(R.layout.lesson_galaxy);

}```


Each with different elements for the RecyclerView's CardView with intents being passed from one to the other.

对多个列表使用单个卡片视图不会有任何问题items.It完全没问题。