【发布时间】:2015-04-30 18:47:39
【问题描述】:
我有一个带有工具的 ABC 类 Serializable
ABC 类是一个报警类,所以使用一堆函数,我只是想从 SD 卡上传图像,我需要在 GRIDVIEW 中查看图像然后用户需要选择 IMAGE,这就是过程
我有一个名为getImage() 的方法可以从 sd 卡中获取图像..
public void getImage() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),1);
}
收到错误The method startActivityForResult(Intent, int) is undefined for the type ABC
我该如何纠正这个问题?
【问题讨论】:
-
要从非活动和非片段类开始和活动,将需要上下文并且您可以从活动中获取。
标签: android android-layout android-image android-alarms android-layout-weight