Source Code Not Found?


Last Updated:

  1. Ryanteck

    Ryanteck Well-Known Member This Topic's Starter

    Joined:
    Jul 28, 2010
    Messages:
    77
    Likes Received:
    3
    Hey guys
    im trying to create a image button app but it always comes up with source code not found?
    i have tryed it using diffrent project bases ( 2.1 and 1.6)

    why wont it work?
    my code is below
    Code (Text):
    1.  
    2. package com.ryanteck.buttontest;
    3.  
    4. import android.app.Activity;
    5. import android.os.Bundle;
    6. import android.view.View;
    7. import android.widget.Button;
    8. import android.widget.TextView;
    9.  
    10. public class easybutton extends Activity {
    11.     /** Called when the activity is first created. */
    12.     @SuppressWarnings("unused")
    13.     @Override
    14.     public void onCreate(Bundle savedInstanceState) {
    15.         super.onCreate(savedInstanceState);
    16.         setContentView(R.layout.main);
    17.         Button button = (Button)findViewById(R.id.ImageButton01);
    18.         TextView text = (TextView)findViewById(R.string.hello);
    19.        
    20.         button.setOnClickListener(new View.OnClickListener() {
    21.         @SuppressWarnings("null")
    22.         public void onClick(View v) {
    23.         TextView text = null;
    24.         text.setText("button pressed");
    25.  
    26.         }
    27.         });
    28.         }
    29.        
    30.     }
    31.  
     

    Advertisement
  2. Ryanteck

    Ryanteck Well-Known Member This Topic's Starter

    Joined:
    Jul 28, 2010
    Messages:
    77
    Likes Received:
    3
    still no help?
     
  3. Ryanteck

    Ryanteck Well-Known Member This Topic's Starter

    Joined:
    Jul 28, 2010
    Messages:
    77
    Likes Received:
    3
    Altough i have killed my android i still would like to know how i could fix this problem ? there must be some way to fix it
     
  4. mohitjaitly

    mohitjaitly Active Member

    Joined:
    Oct 18, 2010
    Messages:
    34
    Likes Received:
    0
    well you need to make sure, build path is set properly and pre-requisites of android app are there.
    another thing, is also not right -
    TextView text = null;
    text.setText("button pressed");
     

Share This Page

Loading...