小编ven*_*wda的帖子

使用意图捕获图片后,应用程序崩溃

使用intents.log cat捕获5到6张照片后,我的应用程序崩溃了.我无法找到崩溃的原因.请帮帮我.

    private void capturePhoto() {

        File root = new File(Environment.getExternalStorageDirectory(), "Feedback");
        if (!root.exists()) {
            root.mkdirs();
        }
        File file = new File(root, Constants.PROFILE_IMAGE_NAME + ".jpeg");
        Uri outputFileUri = Uri.fromFile(file);


        Intent photoPickerIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        photoPickerIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
        photoPickerIntent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
        photoPickerIntent.putExtra("return-data", true);
        photoPickerIntent.putExtra("android.intent.extras.CAMERA_FACING", 1);
        startActivityForResult(photoPickerIntent, requestCode);


    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (this.requestCode == requestCode && resultCode == RESULT_OK) {

            File root = new File(Environment.getExternalStorageDirectory(), "Feedback");
            if (!root.exists()) {
                root.mkdirs();
            }
            File file …
Run Code Online (Sandbox Code Playgroud)

android

13
推荐指数
1
解决办法
1108
查看次数

有没有办法从android studio生成序列图

我已经创建了示例android项目.现在我必须为此创建序列图.有没有办法从android studio自动生成android项目的序列图.

android uml sequence-diagram android-studio

8
推荐指数
2
解决办法
9605
查看次数

无法导入静态android.support.test.espresso.contrib.DrawerMatchers.isOpen;

我正在使用espresso来测试我的Android应用程序.当我试图为导航抽屉菜单编写测试用例时,我无法导入任何这些

import static android.support.test.espresso.contrib.DrawerActions.closeDrawer;
import static android.support.test.espresso.contrib.DrawerActions.openDrawer;
import static android.support.test.espresso.contrib.DrawerMatchers.isClosed;
import static android.support.test.espresso.contrib.DrawerMatchers.isOpen;
Run Code Online (Sandbox Code Playgroud)

所以请帮助我

android android-espresso android-espresso-recorder

4
推荐指数
1
解决办法
3089
查看次数

如何在单击后更改回收器视图中的特定图像

我想在Recycler视图中更改单击项目的相应图像.现在发生的事情是,如果我点击第2项图像正在改变列表中的随机项目位置

public class MyRecyclerViewAdapter extends RecyclerView.Adapter<MyRecyclerViewAdapter.DataObjectHolder> {

private static String LOG_TAG = "MyRecyclerViewAdapter";
private ArrayList<CRMbean> mDataset;
private static MyClickListener myClickListener;
static Context mContext;
private List<String> mtList ;


public MyRecyclerViewAdapter(List<String> filteredList, CRMactivity crMactivity) {
    mtList = filteredList;

}

public static class DataObjectHolder extends RecyclerView.ViewHolder
        implements View
        .OnClickListener {
    public static ImageView testImage;
    TextView name;
    TextView regId;
    TextView roomNo;

    public DataObjectHolder(View itemView) {
        super(itemView);
        name = (TextView) itemView.findViewById(R.id.name);
        regId = (TextView)itemView.findViewById(R.id.reg_id);
        roomNo = (TextView)itemView.findViewById(R.id.roomno);
         testImage = (ImageView)itemView.findViewById(R.id.logo);


        Log.i(LOG_TAG, "Adding Listener");
        itemView.setOnClickListener(this);
    } …
Run Code Online (Sandbox Code Playgroud)

android uiimageview android-recyclerview

3
推荐指数
1
解决办法
8299
查看次数