Font change in textview in an activity
<p>In my application i am displaying some data in an activity.If user clicks on 1 image the fontsize of the data should change.But in my case nothing is happening..I have set the data for this page using AdpaterClass.</p>

<p>My activity code:</p>

<pre><code>public class NewsDescription extends Activity
{

     public void onCreate(Bundle savedInstanceState) 
        {
            super.onCreate(savedInstanceState);  
            setContentView(R.layout.newsdescriptionrow);      

            Gallery gl=(Gallery)findViewById(R.id.GalleryNewsDesc);
            NewsDescriptionAdapter adapter =new NewsDescriptionAdapter(this);
            gl.setAdapter(adapter);   

            ImageView img=(ImageView)findViewById(R.id.fontimage);

            TextView prevnews=(TextView)findViewById(R.id.prevnews);

            prevnews.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    System.out.println("subbu"); 

                }
            });

            img.setOnClickListener(new View.OnClickListener()     ----------&gt;this is the clicking part of the image.
            {               
                @Override
                public void onClick(View arg0) {
                    // TODO Auto-generated method stub
                    System.out.println("Inside click");

                }
            });            


        }


}
</code></pre>

<p>My adpater class:</p>

<pre><code>public class NewsDescriptionAdapter extends  BaseAdapter
{
    private static Context contxt;

    String[] body= {};//new String[30];
    String[] heading= {};//new String[30];
    private Integer mImageIds = R.drawable.font;
    int font = 10;
//  
    NewsDescriptionAdapter(Context conxt)
    {
//      System.out.println("inside cons");
        this.contxt=conxt;
        getelement();
    }   
    public NewsDescriptionAdapter(OnClickListener onClickListener) {
        System.out.println("prakashhh....");
        font = 20;
        getelement();
        // TODO Auto-generated constructor stub
    }
    public void getelement()
    {
        String[] url=context.getInstance().getselectedUrl();
        int count = Integer.parseInt((String)context.getInstance().getAppVariable("count"));
         String URL = "http://m.indiatoday.in/xml/stories/"+url[count];
         TaplistingParser parser = new TaplistingParser();

            URL=URL.replace(" ","");
//          System.out.println("url="+url);
            String xml= parser.getXmlFromUrl(URL);
            Document doc=parser.getDomElement(xml);                 
            NodeList n1 = doc.getElementsByTagName("item");
            body = new String[n1.getLength()];
            heading = new String[n1.getLength()];
            for( int i = 0 ; i &lt; n1.getLength(); i++ )
            {
//              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                Element e = (Element) n1.item(i);
                body[i]=parser.getValue(e, "body");
                heading[i]=parser.getValue(e, "headline");
//              map.put("Body", parser.getValue(e,"body"));             
//              menuItems.add(map);
            }
    }
//  }
    @Override
    public int getCount() 
    {
        // TODO Auto-generated method stub
        return body.length;
    }

    @Override
    public Object getItem(int position) 
    {
        // TODO Auto-generated method stub
        return body[position];
    }

    @Override
    public long getItemId(int position) 
    {
        // TODO Auto-generated method stub
        return position;
    }

     View rowView ;
     int Position=0;
    @Override
    public View getView(int position, View convertView, ViewGroup parent) 
    {
        this.Position=position;
        // TODO Auto-generated method stub

        rowView = LayoutInflater
                 .from(parent.getContext())
                 .inflate(R.layout.newsdescriptionrow, null);      -------&gt; This is the layout where that imageview is present.

          TextView prevnews=(TextView)rowView.findViewById(R.id.prevnews);
          TextView nextnews=(TextView)rowView.findViewById(R.id.nextnews);

          ImageView img=(ImageView)rowView.findViewById(R.id.fontimage);
          img.setImageResource(mImageIds);

          prevnews.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                System.out.println("inside prev");

            }
        });

          nextnews.setOnClickListener(new View.OnClickListener() 
          {
            @Override

            public void onClick(View arg0) {
                System.out.println("inside next");
                int count = Integer.parseInt((String)context.getInstance().getAppVariable("count"));
                count ++;
                context.getInstance().setAppVariable("count",Integer.toString(count));


                // TODO Auto-generated method stub

            }
        });



         TextView textViewhead = (TextView) rowView
                    .findViewById(R.id.name_DescHeading);
         textViewhead.setText(heading[position]);

             TextView textView = (TextView) rowView
                    .findViewById(R.id.name_Desclabel);
            textView.setText(body[position]);
            System.out.println("font="+font);
//          textView.setTextSize(font);

            textViewhead.setTextSize(Integer.parseInt((String)context.getInstance().getAppVariable("nd_heading_size")));
            textViewhead.setTextColor(Integer.parseInt((String)context.getInstance().getAppVariable("nd_heading_color")));
//            textViewhead.setTypeface(((String)context.getInstance().getAppVariable("nd_heading_size")));

            textView.setTextSize(Integer.parseInt((String)context.getInstance().getAppVariable("nd_content_size")));
            textView.setTextColor(Integer.parseInt((String)context.getInstance().getAppVariable("nd_content_color")));
//            textView.setTypeface(tf);





        return rowView;
    }
}
</code></pre>
