6.4

记录代码部分编写
public class RecordDetailActivity extends AppCompatActivity {

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

Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Record Detail");

toolbar.setNavigationOnClickListener(view -> finish());

TextView textViewResult = findViewById(R.id.textView_result);
TextView textViewMood = findViewById(R.id.textView_mood);
ImageView imageViewResult = findViewById(R.id.imageView_result);

String age = getIntent().getStringExtra("age");
String beauty = getIntent().getStringExtra("beauty");
String expression = getIntent().getStringExtra("expression");
String mood = getIntent().getStringExtra("mood");
String imageBase64 = getIntent().getStringExtra("image");
String date = getIntent().getStringExtra("date");

String resultText = "日期: " + date + "\n年龄: " + age + "\n颜值: " + beauty + "\n表情: " + expression;
textViewResult.setText(resultText);
textViewMood.setText("Mood: " + mood);

byte[] imageBytes = android.util.Base64.decode(imageBase64, android.util.Base64.DEFAULT);
imageViewResult.setImageBitmap(android.graphics.BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.length));
}
}
posted @ 2024-06-04 23:48  涨涨涨张  阅读(2)  评论(0编辑  收藏  举报