не получается вывести картинку из assets
public Bitmap setBitmap(String name){
AssetManager assetManager = null;
InputStream inputStream = null;
try {
assert assetManager != null;
inputStream = assetManager.open(name);
} catch (Exception e){
Log.d(StaticData.log, e.getMessage());
}
return BitmapFactory.decodeStream(inputStream);
}
public class GeneralInformation extends AppCompatActivity {
TextView textViewGenInfo;
ImageView imageView;
Image image;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_general_info);
textViewGenInfo = (TextView) findViewById(R.id.textViewGenInfo);
imageView = (ImageView) findViewById(R.id.imageViewGenInfo);
try {
DataHelper dataHelper = new DataHelper(getApplicationContext());
Cursor cursor = dataHelper.getCursor();
String string = "";
if (cursor.moveToFirst()){
string = cursor.getString(cursor.getColumnIndexOrThrow(DataHelper.TableName.TEXT));
} while (cursor.moveToNext());
textViewGenInfo.setText(Html.fromHtml(string));
image = new Image();
imageView.setImageBitmap(image.setBitmap(getApplicationContext()
.getExternalFilesDir("size_1.jpg").getAbsolutePath()));
} catch (Exception e){
Log.d(StaticData.log, e.getMessage());
}
}
}