From 46842c7694a1c0cbd27de16549cf45491738a88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=96=E9=9B=A8=E9=9C=B2?= <477905617@qq.com> Date: Fri, 28 Apr 2023 08:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.txt | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/test.txt b/test.txt index f90977e..a05a48c 100644 --- a/test.txt +++ b/test.txt @@ -1,29 +1 @@ -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - this.setContentView(R.layout.note_edit); - - if (savedInstanceState == null && !initActivityState(getIntent())) { - finish(); - return; - } - initResources(); - - //根据id获取添加图片按钮 - final ImageButton add_img_btn = (ImageButton) findViewById(R.id.add_img_btn); - //为点击图片按钮设置监听器 - add_img_btn.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Log.d(TAG, "onClick: click add image button"); - //ACTION_GET_CONTENT: 允许用户选择特殊种类的数据,并返回(特殊种类的数据:照一张相片或录一段音) - Intent loadImage = new Intent(Intent.ACTION_GET_CONTENT); - //Category属性用于指定当前动作(Action)被执行的环境. - //CATEGORY_OPENABLE; 用来指示一个ACTION_GET_CONTENT的intent - loadImage.addCategory(Intent.CATEGORY_OPENABLE); - loadImage.setType("image/*"); - startActivityForResult(loadImage, PHOTO_REQUEST); - } - }); -} - - +111112222 \ No newline at end of file