我的activity_main.xml上有一个cardView,带有线性布局,以及textView和imageButtons。如何将具有随机彩色背景的TextView下载为jpeg文件并将其存储在手机的外部存储中?
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
android:background="@android:color/white"
tools:context=".MainActivity">
<com.wenchao.cardstack.CardStack
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_marginTop="16dp"
android:clipChildren="false"
android:clipToPadding="false"
android:gravity="center"
android:padding="10dp"
app:card_enable_loop="true"
app:card_enable_rotation="true"
app:card_gravity="top"
app:card_margin="10dp"
app:card_stack_size="4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:onClick="favActivity"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/container" />