I am trying to create a method that returns titleFont and contentFont typeface so that it would improve efficiency by just returning reference and reduce length of code. I know its easy but I am not getting the way. Can anyone help please. or any alternatives would be appreciated.. Sorry for bad english
Here is the method that will be running several times..
protected void onPostExecute(Article result) {
super.onPostExecute(result);
TextView txtTitle= (TextView) view.findViewById(R.id.title);
txtTitle.setTypeface(titleFont);
txtTitle.setText(result.getTitle());
private Typeface titleFont=Typeface.createFromAsset(context.getAssets(),"fonts/InterstateCondMonoLgt.ttf");
private Typeface contentFont=Typeface.createFromAsset(context.getAssets(),"fonts/InterstateLight.ttf");
TextView txtMain= (TextView) view.findViewById(R.id.main);
txtMain.setTypeface(contentFont);
txtMain.setText(result.getContent());
}