I'd like to change the font in textview which is in dialog:
dialog = new Dialog(MyActivity.this);
dialog.setContentView(R.layout.my_dialog);
dialog.setCancelable(true);
((TextView)findViewById(R.id.dialog_box_title_text)).setTypeface(Typeface.createFromAsset(getAssets(), "font.ttf"));
But every time I get the runtime exception:
E/AndroidRuntime(4475): java.lang.IllegalStateException: Could not execute method of the activity
Do you have any idea what is wrong? Because normally it works fine. Problem is only when try to change the font in dialog.
Try this, and let me know what happen.
((TextView)dialog.findViewById(R.id.dialog_box_title_text)).setTypeface(Typeface.createFromAsset(getAssets(), "font.ttf"));