Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 附件在ExpandableListAdapter中不工作_Android - Fatal编程技术网

Android 附件在ExpandableListAdapter中不工作

Android 附件在ExpandableListAdapter中不工作,android,Android,我正在我的应用程序中使用。我的CustomExpandableListAdapter中有一个附件按钮。当我点击附件按钮时,它要求我选择文件并上传。我已经按照上面的链接编写了这段代码 Button attachment = (Button) convertView.findViewById(R.id.attachment); attachment.setOnClickListener(new OnClickListener() { @Override p

我正在我的应用程序中使用。我的CustomExpandableListAdapter中有一个附件按钮。当我点击附件按钮时,它要求我选择文件并上传。我已经按照上面的链接编写了这段代码

 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