I have made an android application,And I am stuck at the point as it gives me an exception,That I am not getting,The Exception is about permission,I have tried to write this permission to manifest file to but its not working,My Exception is as below: code
if(selectPhotoCountryActivity.picturePath2 != null && selectPhotoCountryActivity.picturePath2 !="" )
{
// yourBitmap = BitmapFactory.decodeFile(selectPhotoMainActivity.picturePath);
try
{
yourBitmap = BitmapFactory.decodeFile(selectPhotoCountryActivity.picturePath2);
resized = Bitmap.createScaledBitmap(yourBitmap, 200, 300, true);
imageView4Photo = new ImageView(this);
frm_v.destroyDrawingCache();
imageView3Frame = new ImageView(this);
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.img_back_frm));
// imageView5 = new ImageView(this);
// imageView5.setImageDrawable(getResources().getDrawable(R.drawable.secondscimgbgwithshadow));
//as
/* if(imageView3 == null)
{
imageView3.setImageDrawable(getResources().getDrawable(R.drawable.fram2));
}*/
if(imageView3Frame.getDrawable() != null)
{
width = imageView3Frame.getDrawable().getMinimumWidth();//+80;
height = imageView3Frame.getDrawable().getMinimumHeight();//+80;
//image_view3.getLayoutParams().height = 250;
Log.e("test ","is i3 is not null");
}
Resources resources = this.getResources();
DisplayMetrics metrics = resources.getDisplayMetrics();
if (width > metrics.widthPixels)
{
width = metrics.widthPixels;//+80;
height = width * height / imageView3Frame.getDrawable().getMinimumWidth();//+80;
Log.e("test ","is i3 is not null width > metrics.w....");
}
frm_v.removeAllViews();
// imageView5.
int width1=230,height1=200;
// LayoutParams params2=new LayoutParams(width1, height1);
LayoutParams params=new LayoutParams(width, height);
// LayoutParams param=new LayoutParams(300, 300);
//imageView3.
frm_v.addView(imageView3Frame, params);
// frm_v.addView(imageView4Photo,params);
FrameLayout.LayoutParams paramss = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER);
((FrameLayout) findViewById(R.id.frm_layout_photo_frame)).addView(imageView4Photo, paramss);
// frm_v.addView(imageView5,params);
imageView4Photo.setImageBitmap(resized);
//imageView4.setOnTouchListener(new Touch(SetPhotoFrameActivity.this));
imageView4Photo.setVisibility(View.GONE);
imageView3Frame.bringToFront();
imageView4Photo.setVisibility(View.VISIBLE);
}
catch (Exception e)
{
e.printStackTrace();
}
if(SelectPhotoCountryActivity.countryName2 != null && SelectPhotoCountryActivity.countryName2 !="" )
{
//SelectPhotoCountryActivity.countryName2;
try
{
if(SelectPhotoCountryActivity.countryName2.equals("USA"))
{
Log.i("select frame of","USA");
//imageView32 = new ImageView(this);
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.usa_frame));
}
/*else if(SelectPhotoCountryActivity.countryName2.equals("USA"))
{
Log.i("select frame of","USA");
//imageView32 = new ImageView(this);
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.usa_frame));
}*/
else if (SelectPhotoCountryActivity.countryName2.equals("Algeria"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.algeria));
}//2
else if (SelectPhotoCountryActivity.countryName2.equals("Cameroon"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.camerron));
}//3
else if (SelectPhotoCountryActivity.countryName2.equals("Côte d`Ivoire"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.cotedlvorie));
}//4
else if (SelectPhotoCountryActivity.countryName2.equals("Ghana"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.ghana));
}//5
else if (SelectPhotoCountryActivity.countryName2.equals("Nigeria"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.nigeria));
}//6
else if (SelectPhotoCountryActivity.countryName2.equals("Australia"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.australia));
}//7
else if (SelectPhotoCountryActivity.countryName2.equals("Iran"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.iran));
}//8 remain
else if (SelectPhotoCountryActivity.countryName2.equals("Japan"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.japan));
}//9
else if (SelectPhotoCountryActivity.countryName2.equals("Korea Republic"))
{
imageView3Frame.setImageDrawable(getResources().getDrawable(R.drawable.korearepublic));
}//10
else if (SelectPhotoCountryActivity.countryName2.equals("Belgium"))
{
log.txt
06-12 12:00:21.285: E/AndroidRuntime(18813): FATAL EXCEPTION: main
06-12 12:00:21.285: E/AndroidRuntime(18813): java.lang.OutOfMemoryError
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:586)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:439)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.content.res.Resources.loadDrawable(Resources.java:2988)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.content.res.Resources.getDrawable(Resources.java:1558)
06-12 12:00:21.285: E/AndroidRuntime(18813): at com.example.footballapp.SetPhotoFrameActivity.buttonClickEvents(SetPhotoFrameActivity.java:371)
06-12 12:00:21.285: E/AndroidRuntime(18813): at com.example.footballapp.SetPhotoFrameActivity.onCreate(SetPhotoFrameActivity.java:197)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.app.Activity.performCreate(Activity.java:5372)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.app.ActivityThread.access$700(ActivityThread.java:168)
06-12 12:00:21.285: E/AndroidRuntime(18813): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)