title: OnClickListener and textView set text
body: <p>I'm trying to dynamically set the text of my textView but I can't display neither the text nor the <code>logcat</code> message.</p>
  
  <p>The app launch don't cause any errors. I've tried to use the <code>onClick</code> attribute in xml file instead of the <code>click listener</code> to launch a method that set the text but even so doesn't work,please help me.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>public class Anteprima extends Activity{
  
   TextView tx;
   Button button;
   ZoomControls zoom;
  
  
   @Override
   public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.anteprima);
      tx = (TextView)findViewById(R.id.textView1);
      button = (Button)findViewById(R.id.button1);
      tx.setText("0000000");
      button.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v) {
               tx.setText("clickk");
              Log.i("anteprima ","click");
  
          }});
      targetPath = getIntent().getExtras().getString("target");
       contenutoPath = getIntent().getExtras().getString("contenuto");
      zoom = (ZoomControls)findViewById(R.id.zoomControls1);
  
      zoom.setIsZoomInEnabled(true);
      zoom.setIsZoomOutEnabled(true);
  
      zoom.setOnZoomInClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View v) {
              tx.setText("piu");
          }
  
      });
      zoom.setOnZoomOutClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View v) {
              tx.setText("meno");
          }
      });
       }
  }
  </code></pre>
  
  <p>and here it is the layout </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      android:text="Button"
       /&gt;
  
  &lt;ZoomControls
      android:id="@+id/zoomControls1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:layout_marginBottom="32dp" /&gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/button1"
      android:layout_centerHorizontal="true"
      android:layout_marginBottom="38dp"
      android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>this is the entire activity</p>
  
  <pre><code>package com.tesi.AR;
  
  
  
  
  import com.metaio.sdk.ARViewActivity;
  import com.metaio.sdk.jni.IGeometry;
  import com.metaio.sdk.jni.IMetaioSDKCallback;
  
  
  public class Anteprima extends ARViewActivity{
  
  public IGeometry mVideo;
   String targetPath;
  String contenutoPath;
  String AR_FOLDER = "/mnt/sdcard/AR";
  float scale = 1.0f;
  TextView tx;
  Button button;
  ZoomControls zoom;
  File xmlTemp;
  
  @Override
  public void onCreate(Bundle savedInstanceState){
       super.onCreate(savedInstanceState);
      setContentView(R.layout.anteprima);
      tx = (TextView)findViewById(R.id.textView1);
      button = (Button)findViewById(R.id.button1);
      tx.setText("0000000");
      button.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v) {
              tx.setText("clickk");
              Log.i("anteprima ","click");
  
          }});
      targetPath = getIntent().getExtras().getString("target");
      contenutoPath = getIntent().getExtras().getString("contenuto");
      zoom = (ZoomControls)findViewById(R.id.zoomControls1);
  
      zoom.setIsZoomInEnabled(true);
       zoom.setIsZoomOutEnabled(true);
  
      zoom.setOnZoomInClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View v) {
              tx.setText("piu");
          }
  
      });
      zoom.setOnZoomOutClickListener(new View.OnClickListener(){
          @Override
           public void onClick(View v) {
              tx.setText("meno");
           }
  
      });
  
      Log.i("anteprima", targetPath);
      Log.i("anteprima", contenutoPath);
  
      //verifica esistenza dello spazio di memoria dedicato all'app
      File arFolder = new File(AR_FOLDER);
      File targetFolder = new File(arFolder, "Targets");
      File contenutiFolder = new File(arFolder, "Contenuti");
  
      if(!arFolder.exists()){
          Log.i("anteprima", "Cartella non trovata provvedo alla creazione");
          arFolder.mkdirs();
          arFolder.setReadable(true);
          Log.i("anteprima", "Cartella AR creata");
          targetFolder.mkdir(); 
          contenutiFolder.mkdir(); 
      } 
      File targetFakePathFile = new File(targetPath);
      File targetPathFile = new File (targetFolder,targetFakePathFile.getName());
      //provo a creare il nuovo file
      try { 
          targetPathFile.createNewFile();
      } catch (IOException e) { 
          // TODO Auto-generated catch block 
          e.printStackTrace(); 
      } 
      //Provo a copiare  il file target in targets folder
      try { 
          Utility.copyFile(targetFakePathFile, targetPathFile);
       } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
       xmlTemp = new File(targetFolder,"temp.xml");
      //Creo il file di configurazione temporaneo
      try {
          xmlTemp.createNewFile();
      } catch (IOException e) {
          // TODO Auto-generated catch block
           e.printStackTrace();
      }
      TrackingConfigurationXML tcx = newTrackingConfigurationXML("Nome_Sensore");
      SensorCOS sc = new SensorCOS("idSensore",targetPathFile.getName());
  
      COS cos = new COS("cos1", "trackingId", sc);
  
      String xml =   tcx.toStringTheStartXML()+sc.toString()+tcx.toStringTheMiddleXML()+cos.toString()+tcx.toStr    ingTheEndXML();
      BufferedWriter buffWriter = null;
       //scrive sul file xml le impostazioni
      try {
          buffWriter = new BufferedWriter(new FileWriter(xmlTemp));
       } catch (IOException e) {
          // TODO Auto-generated catch block
           e.printStackTrace();
      }
      try {
          buffWriter.write(xml);
          buffWriter.close();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
  
  
  
  }
  
  @Override
  protected int getGUILayout() {
      return R.layout.anteprima;
  }
  
  @Override
  protected IMetaioSDKCallback getMetaioSDKCallbackHandler() {
  
      return null;
  }
  
  @Override
  protected void loadContents() {
      String xmlPath = xmlTemp.getAbsolutePath();
      boolean result = metaioSDK.setTrackingConfiguration(xmlPath);
      Log.i("anteprima", "set tarcking conf = "+result);
      mVideo = metaioSDK.createGeometryFromMovie(contenutoPath);
      mVideo.startMovieTexture(true);
  
  }
  /*
  @Override
  public void onDrawFrame() {
      super.onDrawFrame();
      mVideo.setScale(scale);
  }
  */
  @Override
  protected void onGeometryTouched(IGeometry geometry) {
      // TODO Auto-generated method stub
  
  }
  
  }
  </code></pre>