2017-02-01 8 views
-1

私はネイティブのアンドロイド開発に初心者です。私はアンドロイドスタジオで働いています。私は3 tabsです。 1つはmapのためであり、cameraは写真を撮るためのものであり、3つ目はpicturesのものであり、全てが撮影されたものである。私はmapcameraを実装しました。画像を見るために、私はこれに続いていますtutorial。ここにクラスiが追加されましたBitmap image = Bitmap image = decodeFile(_filePaths.get(position), imageWidth, imageWidth);アンドロイドスタジオのメソッドdecodeFileを解決できません

しかし、私はエラーCannot Resolve method decodeFileを表示しています。私はそれを検索し、それに対する解決策を見つけることができませんでした。

は以下どれヘルプは高く評価されるだろう

@Override 
public View getView(int position, View convertView, ViewGroup parent) { 
    ImageView imageView; 
    if (convertView == null) { 
     imageView = new ImageView(_activity); 
    } else { 
     imageView = (ImageView) convertView; 
    } 

    // get screen dimensions 
    Bitmap image = decodeFile(_filePaths.get(position), imageWidth, imageWidth); 

    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); 
    imageView.setLayoutParams(new GridView.LayoutParams(imageWidth, 
      imageWidth)); 
    imageView.setImageBitmap(image); 

    // image view click listener 
    imageView.setOnClickListener(new OnImageClickListener(position)); 

    return imageView; 
} 

私のコードです。

答えて

1

それは私が逃した

+0

はい私の悪い..(チュートリアルでは、decodeFile(という名前のメソッドをコピーするために見逃している必要があります))を再度確認し、クラスで定義されたカスタムメソッドですそれ:| – faisal1208

1

使用この

Bitmap image = BitmapFactory.decodeFile(_filePaths.get(position), imageWidth, imageWidth); 
関連する問題