我的活动中有一个图片视图...我想在图片视图上放置文字视图("点击加载图片" )...当用户单击空图像查看要从那里调用的图库部分,他可以选择图片,并希望在Imageview上加载
我们怎么做?
答案 0 :(得分:3)
试试这个代码......
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Pick Image from")
.setPositiveButton("Camera", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//camera intent
Intent cameraIntent = new Intent(ConversationActivity.this, CameraActivity.class);
cameraIntent.putExtra("EXTRA_CONTACT_JID", contact.getJid());
startActivity(cameraIntent);
}
})
.setNegativeButton("Gallery", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent();
// Show only images, no videos or anything else
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
// Always show the chooser (if there are multiple options available)
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST);
}
});
AlertDialog alert = builder.create();
alert.show();
答案 1 :(得分:2)
postgres=# select * from stringtest ;
id | inputstr
----+-----------------
1 | Name : NOC\r +
| \r +
| Detail : Detail
(1 row)