I am using Custom font in my application using typeface class. when I run my application it crashes and open the .otf file in a tab. Images are linked. Thanx in advance :-)
here is my java code:
TextView text = new TextView(this);
                LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
                //params.setMargins(100,100,500,100);
                Typeface tf = Typeface.createFromAsset(getAssets(),"/fonts/AdobeArabic-Regular.otf");
                text.setTypeface(tf);
                text.setPadding(150,100,150,100);
                text.setGravity(Gravity.CENTER_HORIZONTAL);
                text.setTextColor(getResources().getColor(R.color.White));
                //text.setBackgroundResource(R.color.Green);
                text.setLayoutParams(params);
 
    