Android 附件在ExpandableListAdapter中不工作
我正在我的应用程序中使用。我的CustomExpandableListAdapter中有一个附件按钮。当我点击附件按钮时,它要求我选择文件并上传。我已经按照上面的链接编写了这段代码Android 附件在ExpandableListAdapter中不工作,android,Android,我正在我的应用程序中使用。我的CustomExpandableListAdapter中有一个附件按钮。当我点击附件按钮时,它要求我选择文件并上传。我已经按照上面的链接编写了这段代码 Button attachment = (Button) convertView.findViewById(R.id.attachment); attachment.setOnClickListener(new OnClickListener() { @Override p
Button attachment = (Button) convertView.findViewById(R.id.attachment);
attachment.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(_context, FileChooserActivity.class);
Toast.makeText(_context, "inside attachment", Toast.LENGTH_SHORT).show();
((Activity) _context).startActivityForResult(intent, FILE_CHOOSER);
}
});
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if ((requestCode == FILE_CHOOSER) && (resultCode == Activity.RESULT_OK)) {
String fileSelected = data.getStringExtra(Constants.KEY_FILE_SELECTED);
Toast.makeText(_context, "file selected "+fileSelected, Toast.LENGTH_SHORT).show();
}
}
当我单击该按钮时,应用程序停止。它显示ActivityNotFoundException。请指导我如何在舱单上申报。提前感谢。基本上,在清单中声明活动所需的全部内容就是写入清单文件:
<activity
android:name="com.example.yourProject.ActivityName"
/>
为了进一步阅读活动和清单,我建议
.ActivityName$InnerActivity